-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
dates.date2num no longer works with numpy.datetime64 #2259
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
Comments
The fact that it worked before looks like an accident. mpl has never supported numpy datetime64. Surely we will do so eventually, once this dtype settles down. Perhaps we can start with this particular example, by figuring out why the conversion accidentally did work before it was vectorized. |
Any chance you could provide a SSCCE? |
Absolutely. Again, this worked for weeks prior to building a new matplotlib from master the other day, which is why I think something had changed in mpl. |
Punting this back to 1.5.x, as there is work-around, see https://github.com/pydata/pandas/pull/8054/files |
@fonnesbeck Do you need |
This was so long ago I can't remember what my work-around was. I believe it was for plotting only, however. |
I've run into this issue after upgrading from 2.0.2 to 2.1.0. I have an array of |
Did you also happen to upgrade pandas and are using pandas? The support for
datetime64 actually came from pandas registering a converter upon import,
but the latest version of pandas did not do that.
…On Tue, Nov 28, 2017 at 12:51 PM, Aleks Bunin ***@***.***> wrote:
I've run into this issue after upgrading from 2.0.2 to 2.1.0. I have an
array of dtype='datetime64[D]', which causing similar exception.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2259 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-DxRK4rJvzwoOB8AvvEiG8ILeZM2ks5s7EgHgaJpZM4A29Rt>
.
|
#9779 is an in-house fix... pandas issue: pandas-dev/pandas#18301 Work around: from pandas.tseries import converter
converter.register() |
I'm going to close this given #9779, and the SSCCE is not available anymore. |
I'm not using pandas, only numpy. Somehow this worked for us upto and including in 2.0.2. Is there an eta when #9779 will be released? Is it scheduled for patch release, or for the next minor release, i.e 2.3.0? |
When it was working, I suspect that pandas was being imported, even if you weren't actually using it. Just the import was sufficient to install its converters. |
After updating matplotlib from master yesterday, calling
dates.date2num
on either a Pandas Series or a numpy array of numpy.datetime64 types raises anAttributeError
:The data looks like this:
This worked prior to the update. Running yesterday's master on OS X 10.8.4 and Python 2.7.2.
The text was updated successfully, but these errors were encountered: