Skip to content

Commit 220c18d

Browse files
Doc/59592/fix docstring validation errors (#59611)
* adding extended summary, populating return description and adding see also section * populating return description section * populating return description section * fixing zfil docstrign as per PR #59597 * removing methods whose docstrign has been fixed from code_checks.sh script --------- Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 91541c1 commit 220c18d

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

ci/code_checks.sh

-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7171
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
7272
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
7373
-i "pandas.MultiIndex.reorder_levels RT03,SA01" \
74-
-i "pandas.MultiIndex.to_frame RT03" \
7574
-i "pandas.NA SA01" \
7675
-i "pandas.NaT SA01" \
7776
-i "pandas.Period.freq GL08" \
@@ -128,7 +127,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
128127
-i "pandas.Timedelta.to_timedelta64 SA01" \
129128
-i "pandas.Timedelta.total_seconds SA01" \
130129
-i "pandas.Timedelta.view SA01" \
131-
-i "pandas.TimedeltaIndex.as_unit RT03,SA01" \
132130
-i "pandas.TimedeltaIndex.components SA01" \
133131
-i "pandas.TimedeltaIndex.microseconds SA01" \
134132
-i "pandas.TimedeltaIndex.nanoseconds SA01" \

pandas/core/indexes/datetimelike.py

+12
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,25 @@ def as_unit(self, unit: str) -> Self:
441441
"""
442442
Convert to a dtype with the given unit resolution.
443443
444+
This method is for converting the dtype of a ``DatetimeIndex`` or
445+
``TimedeltaIndex`` to a new dtype with the given unit
446+
resolution/precision.
447+
444448
Parameters
445449
----------
446450
unit : {'s', 'ms', 'us', 'ns'}
447451
448452
Returns
449453
-------
450454
same type as self
455+
Converted to the specified unit.
456+
457+
See Also
458+
--------
459+
Timestamp.as_unit : Convert to the given unit.
460+
Timedelta.as_unit : Convert to the given unit.
461+
DatetimeIndex.as_unit : Convert to the given unit.
462+
TimedeltaIndex.as_unit : Convert to the given unit.
451463
452464
Examples
453465
--------

pandas/core/indexes/multi.py

+1
Original file line numberDiff line numberDiff line change
@@ -1894,6 +1894,7 @@ def to_frame(
18941894
Returns
18951895
-------
18961896
DataFrame
1897+
DataFrame representation of the MultiIndex, with levels as columns.
18971898
18981899
See Also
18991900
--------

0 commit comments

Comments
 (0)