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
[Bug]: OverflowError in time series plot after frequency conversion #25600
Comments
In the second case pandas installs a different unit converter than in the first:
I suspect (but have not tracked down) that the The fix for this is probably on the pandas side. |
Yes, Sadly you can't mix our Locators with Pandas converters. Pandas will either have to start converting to our epoch or set the epoch to their epoch when they install their converters. I feel it is quite confusing for downstream libraries to have converters that are not compatible with ours, because it leads to crossed expectations like this. We perhaps should consider some way to mark an axis as incompatible with certain locators... |
Would the work for #24951 help us create a more informative error message here? |
If this is a pandas issue: was this reported to pandas already? If so, it might be helpful to provide a reference. If not, the issue should be raised there to enable solution-finding. |
Yes please open at pandas and come back here if matplotlib can help. |
Turns out it is already being discussed in pandas here. |
Bug summary
After applying a
df1.resample('10S').asfreq()
transformation to a timeseries pandas dataframe I get an OverflowError error when trying to format the X-axis.
Before the transformation the ploting works.
Code for reproduction
Actual outcome
--> 359 np.timedelta64(int(np.round(x * MUSECONDS_PER_DAY)), 'us'))
360 if dt < np.datetime64('0001-01-01') or dt >= np.datetime64('10000-01-01'):
361 raise ValueError(f'Date ordinal {x} converts to {dt} (using '
362 f'epoch {get_epoch()}), but Matplotlib dates must be '
363 'between year 0001 and 9999.')
OverflowError: int too big to convert
Expected outcome
The transformed dataframe can be plotted
Additional information
No response
Operating system
Windows 11
Matplotlib Version
3.7.1
Matplotlib Backend
module://matplotlib_inline.backend_inline
Python version
3.9
Jupyter version
jupyterlab 3.6.3
Installation
conda
The text was updated successfully, but these errors were encountered: