-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: fix to_numpy explanation for tz aware data #24595
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
2. A ``datetime64[ns]`` -dtype :class:`ndarray`, where the values have | ||
been converted to UTC and the timezone discarded | ||
|
||
Timezones may be preserved with ``dtype=object`` |
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.
@TomAugspurger can you double check here? But it seems this section was duplicated (added each time by two related PRs, probably some merging/rebasing left-over)
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.
👍
2. A ``datetime64[ns]`` -dtype :class:`ndarray`, where the values have | ||
been converted to UTC and the timezone discarded | ||
|
||
Timezones may be preserved with ``dtype=object`` |
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.
👍
@@ -2425,21 +2425,25 @@ a convert on an aware stamp. | |||
.. note:: | |||
|
|||
Using :meth:`Series.to_numpy` on a ``Series``, returns a NumPy array of the data. | |||
These values are converted to UTC, as NumPy does not currently support timezones (even though it is *printing* in the local timezone!). | |||
NumPy does not currently support timezones (even though it is *printing* in the local timezone!), |
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.
I don't think the statement about printing is true anymore.
Codecov Report
@@ Coverage Diff @@
## master #24595 +/- ##
=======================================
Coverage 92.36% 92.36%
=======================================
Files 166 166
Lines 52497 52497
=======================================
Hits 48490 48490
Misses 4007 4007
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #24595 +/- ##
=======================================
Coverage 92.36% 92.36%
=======================================
Files 166 166
Lines 52497 52497
=======================================
Hits 48490 48490
Misses 4007 4007
Continue to review full report at Codecov.
|
thanks @jorisvandenbossche |
Tom actually put a review comment, but OK, will fix another time :) |
Some clean-up now
to_numpy
preserves timezone and no longer converts to UTC datetime64 by default (after #24024), the example in timeseries.rst was failing due to that.