-
-
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 3 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,32 @@ class DatetimeProperties(Properties): | |
""" | ||
|
||
def to_pydatetime(self): | ||
""" | ||
Return DatetimeIndex as object ndarray of datetime.datetime objects. | ||
|
||
This function converts the Pandas Series DatetimeIndex to | ||
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. would remove this extended summary 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. Fixed. |
||
a ndarray object. These two types are different and hence | ||
2 differnt functions. | ||
|
||
Returns | ||
------- | ||
datetimes : 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. 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. Fixed. |
||
|
||
See Also | ||
-------- | ||
pd.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. pandas.DatetimeIndex.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. Fixed. |
||
Python datetime object. | ||
pd.date.dt.values.to_datetime : For an Index containing strings or | ||
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. remove this 2nd part which is not valid 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. Fixed. |
||
datetime.datetime objects, attempt conversion to DatetimeIndex. | ||
|
||
Examples | ||
-------- | ||
>>> df = pd.DataFrame({'date': [pd.to_datetime('2018-03-10'), pd.to_datetime('2017-02-01')]}) | ||
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. make a series like: 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. Fixed. |
||
>>> type(df) | ||
<class 'pandas.core.frame.DataFrame'> | ||
>>> type(df.date.dt.to_pydatetime()) | ||
<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.
Return DatetimeIndex as an object ndarray
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.
Thanks. Fixed it.