Skip to content
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

Doc/59592/fix docstring validation errors #59611

Merged
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
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
-i "pandas.MultiIndex.reorder_levels RT03,SA01" \
-i "pandas.MultiIndex.to_frame RT03" \
-i "pandas.NA SA01" \
-i "pandas.NaT SA01" \
-i "pandas.Period.freq GL08" \
Expand Down Expand Up @@ -152,7 +151,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Timedelta.to_timedelta64 SA01" \
-i "pandas.Timedelta.total_seconds SA01" \
-i "pandas.Timedelta.view SA01" \
-i "pandas.TimedeltaIndex.as_unit RT03,SA01" \
-i "pandas.TimedeltaIndex.components SA01" \
-i "pandas.TimedeltaIndex.microseconds SA01" \
-i "pandas.TimedeltaIndex.nanoseconds SA01" \
Expand Down
12 changes: 12 additions & 0 deletions pandas/core/indexes/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,25 @@ def as_unit(self, unit: str) -> Self:
"""
Convert to a dtype with the given unit resolution.

This method is for converting the dtype of a ``DatetimeIndex`` or
``TimedeltaIndex`` to a new dtype with the given unit
resolution/precision.

Parameters
----------
unit : {'s', 'ms', 'us', 'ns'}

Returns
-------
same type as self
Converted to the specified unit.

See Also
--------
Timestamp.as_unit : Convert to the given unit.
Timedelta.as_unit : Convert to the given unit.
DatetimeIndex.as_unit : Convert to the given unit.
TimedeltaIndex.as_unit : Convert to the given unit.

Examples
--------
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,7 @@ def to_frame(
Returns
-------
DataFrame
DataFrame representation of the MultiIndex, with levels as columns.

See Also
--------
Expand Down