-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Convert NaT to nan in date2num #10631
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
Conversation
Thanks @efiring. I'll review after the tests have passed. |
One of the 3.5 tests doesn't like this change, though oddly other tests are Ok w/ it...
|
It's failing on a line in the original code, not a line that I added. Numpy version is 1.10 on the failing test. My PR adds the datetime64[ns] to all the checks because that is the variant that Pandas uses--I suspect that is why we are seeing the failure.
|
... but the old code has been passing... 🐑 |
I know it's late, but I think this is simple enough and important enough to be considered for v2.2. |
Agree that this should go in: the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'll leave it open a bit to let anyone else comment.
Backport PR #10631 on branch v2.2.x
PR Summary
Numpy datetime64 uses a flag value for Not a Time ("NaT"). When converting from datetime64 to Matplotlib's datenum,
dates.date2num
now substitutesnp.nan
for "NaT".PR Checklist