Skip to content

DOC: fixed docstrings for pandas.DatetimeIndex.to_period and pandas.DatetimeIndex.to_pydatetime #58074

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

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.DatetimeIndex.std PR01,RT03" \
-i "pandas.DatetimeIndex.time SA01" \
-i "pandas.DatetimeIndex.timetz SA01" \
-i "pandas.DatetimeIndex.to_period RT03" \
-i "pandas.DatetimeIndex.to_pydatetime RT03,SA01" \
-i "pandas.DatetimeIndex.tz SA01" \
-i "pandas.DatetimeIndex.tz_convert RT03" \
-i "pandas.DatetimeIndex.year SA01" \
Expand Down Expand Up @@ -356,7 +354,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.dt.strftime PR01,PR02" \
-i "pandas.Series.dt.time SA01" \
-i "pandas.Series.dt.timetz SA01" \
-i "pandas.Series.dt.to_period PR01,PR02,RT03" \
-i "pandas.Series.dt.to_period PR01,PR02" \
-i "pandas.Series.dt.total_seconds PR01" \
-i "pandas.Series.dt.tz SA01" \
-i "pandas.Series.dt.tz_convert PR01,PR02,RT03" \
Expand Down
10 changes: 9 additions & 1 deletion pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,13 @@ def to_pydatetime(self) -> npt.NDArray[np.object_]:

Returns
-------
numpy.ndarray
A numpy.ndarray
A numpy.ndarray with ``datetime.datetime`` objects
from the date strings.

See Also
--------
DatetimeIndex.to_pydatetime: Return PeriodArray/PeriodIndex as object.

Examples
--------
Expand Down Expand Up @@ -1193,6 +1199,8 @@ def to_period(self, freq=None) -> PeriodArray:
Returns
-------
PeriodArray/PeriodIndex
PeriodArray/PeriodIndex with each value rounded down
to the frequency specified.

Raises
------
Expand Down
Loading