Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve compatibility issue by using pandas newer version and matplotlib for plotting #452

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

Fujikawas
Copy link
Contributor

For the newer pandas version(2.2.0 for my instance), it requires the data to be converted to a numpy array before indexing for plotting with matplotlib.pyplot.plot(). Otherwise it gives error like:

ValueError: Multi-dimensional indexing (e.g. `obj[:, None]`) is no longer supported. Convert to a numpy array before indexing instead.

The plot-trajectory.py in the tutorial case oscillator is this case.

@Fujikawas
Copy link
Contributor Author

Haven't tested if this works for older version yet. Maybe it's better to add a conditional clause here to decide if the conversion is needed.

Copy link
Member

@BenjaminRodenberg BenjaminRodenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for backwards compatibility. This is a helper script and I think we can expect the (few) users of this script to have a recent version.

@Fujikawas Fujikawas merged commit f377815 into develop Jan 30, 2024
3 checks passed
@Fujikawas Fujikawas deleted the oscillator-plot branch January 30, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants