-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Docstring changes to pandas.Series.dt.to_pydatetime #20198
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
Changes from 5 commits
6480b22
6a643fc
e4dbd78
5523dd5
c83eff0
04dbd04
4f73176
35ce553
0279ae8
d8fe91d
2dd734c
e010c13
34b4e99
932feff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,6 +126,26 @@ class DatetimeProperties(Properties): | |
""" | ||
|
||
def to_pydatetime(self): | ||
""" | ||
Return DatetimeIndex as an object ndarray. | ||
|
||
Returns | ||
------- | ||
ndarray of object dtype | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -> Series of object dtype |
||
|
||
See Also | ||
-------- | ||
pandas.DatetimeIndex.to_pydatetime : Convert a Timestamp object to a native | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is now referencing itself? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, sorry! Missed that this one was in |
||
Python datetime object. | ||
|
||
Examples | ||
-------- | ||
>>> df = pd.Series(pd.date_range('20180310', periods=2)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you call this |
||
>>> type(df) | ||
<class 'pandas.core.series.Series'> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not needed I think |
||
>>> type(df.dt.to_pydatetime()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would actually show the output here, instead of inspecting the type (that will also show it is an array, but also show it holds datetime.datetime objects) |
||
<class 'numpy.ndarray'> | ||
""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I gave up on a tz example since the repr for datetime w/ tz is so long. Wasn't able to make it look nice. |
||
return self._get_values().to_pydatetime() | ||
|
||
@property | ||
|
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 would mention it is an array of "native Python datetime objects" ?
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.
Can you change this to "Return Series" instead of "Return DatetimeIndex" (as it is the accessor on a Series) ?
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.
done, Kindly review