Skip to content

Commit df3b045

Browse files
DOC: Fix order of the sections in docstrings (#24132)
1 parent d9c814f commit df3b045

File tree

8 files changed

+54
-54
lines changed

8 files changed

+54
-54
lines changed

pandas/_libs/interval.pyx

+15-15
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,16 @@ cdef class Interval(IntervalMixin):
158158
Whether the interval is closed on the left-side, right-side, both or
159159
neither. See the Notes for more detailed explanation.
160160
161+
See Also
162+
--------
163+
IntervalIndex : An Index of Interval objects that are all closed on the
164+
same side.
165+
cut : Convert continuous data into discrete bins (Categorical
166+
of Interval objects).
167+
qcut : Convert continuous data into bins (Categorical of Interval objects)
168+
based on quantiles.
169+
Period : Represents a period of time.
170+
161171
Notes
162172
-----
163173
The parameters `left` and `right` must be from the same type, you must be
@@ -226,16 +236,6 @@ cdef class Interval(IntervalMixin):
226236
>>> volume_1 = pd.Interval('Ant', 'Dog', closed='both')
227237
>>> 'Bee' in volume_1
228238
True
229-
230-
See Also
231-
--------
232-
IntervalIndex : An Index of Interval objects that are all closed on the
233-
same side.
234-
cut : Convert continuous data into discrete bins (Categorical
235-
of Interval objects).
236-
qcut : Convert continuous data into bins (Categorical of Interval objects)
237-
based on quantiles.
238-
Period : Represents a period of time.
239239
"""
240240
_typ = "interval"
241241

@@ -387,6 +387,11 @@ cdef class Interval(IntervalMixin):
387387
bool
388388
``True`` if the two intervals overlap, else ``False``.
389389
390+
See Also
391+
--------
392+
IntervalArray.overlaps : The corresponding method for IntervalArray
393+
IntervalIndex.overlaps : The corresponding method for IntervalIndex
394+
390395
Examples
391396
--------
392397
>>> i1 = pd.Interval(0, 2)
@@ -409,11 +414,6 @@ cdef class Interval(IntervalMixin):
409414
>>> i6 = pd.Interval(1, 2, closed='neither')
410415
>>> i4.overlaps(i6)
411416
False
412-
413-
See Also
414-
--------
415-
IntervalArray.overlaps : The corresponding method for IntervalArray
416-
IntervalIndex.overlaps : The corresponding method for IntervalIndex
417417
"""
418418
if not isinstance(other, Interval):
419419
msg = '`other` must be an Interval, got {other}'

pandas/_libs/tslibs/nattype.pyx

+4-4
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,6 @@ class NaTType(_NaT):
471471
"""
472472
Round the Timestamp to the specified resolution
473473
474-
Returns
475-
-------
476-
a new Timestamp rounded to the given resolution of `freq`
477-
478474
Parameters
479475
----------
480476
freq : a freq string indicating the rounding resolution
@@ -497,6 +493,10 @@ class NaTType(_NaT):
497493
498494
.. versionadded:: 0.24.0
499495
496+
Returns
497+
-------
498+
a new Timestamp rounded to the given resolution of `freq`
499+
500500
Raises
501501
------
502502
ValueError if the freq cannot be converted

pandas/_libs/tslibs/timedeltas.pyx

+8-8
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,10 @@ cdef class _Timedelta(timedelta):
10731073
-------
10741074
formatted : str
10751075
1076+
See Also
1077+
--------
1078+
Timestamp.isoformat
1079+
10761080
Notes
10771081
-----
10781082
The longest component is days, whose value may be larger than
@@ -1095,10 +1099,6 @@ cdef class _Timedelta(timedelta):
10951099
'P0DT0H0M10S'
10961100
>>> pd.Timedelta(days=500.5).isoformat()
10971101
'P500DT12H0MS'
1098-
1099-
See Also
1100-
--------
1101-
Timestamp.isoformat
11021102
"""
11031103
components = self.components
11041104
seconds = '{}.{:0>3}{:0>3}{:0>3}'.format(components.seconds,
@@ -1224,14 +1224,14 @@ class Timedelta(_Timedelta):
12241224
"""
12251225
Round the Timedelta to the specified resolution
12261226
1227-
Returns
1228-
-------
1229-
a new Timedelta rounded to the given resolution of `freq`
1230-
12311227
Parameters
12321228
----------
12331229
freq : a freq string indicating the rounding resolution
12341230
1231+
Returns
1232+
-------
1233+
a new Timedelta rounded to the given resolution of `freq`
1234+
12351235
Raises
12361236
------
12371237
ValueError if the freq cannot be converted

pandas/_libs/tslibs/timestamps.pyx

+4-4
Original file line numberDiff line numberDiff line change
@@ -776,10 +776,6 @@ class Timestamp(_Timestamp):
776776
"""
777777
Round the Timestamp to the specified resolution
778778
779-
Returns
780-
-------
781-
a new Timestamp rounded to the given resolution of `freq`
782-
783779
Parameters
784780
----------
785781
freq : a freq string indicating the rounding resolution
@@ -802,6 +798,10 @@ class Timestamp(_Timestamp):
802798
803799
.. versionadded:: 0.24.0
804800
801+
Returns
802+
-------
803+
a new Timestamp rounded to the given resolution of `freq`
804+
805805
Raises
806806
------
807807
ValueError if the freq cannot be converted

pandas/core/accessor.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ def decorator(accessor):
201201
Name under which the accessor should be registered. A warning is issued
202202
if this name conflicts with a preexisting attribute.
203203
204+
See Also
205+
--------
206+
%(others)s
207+
204208
Notes
205209
-----
206210
When accessed, your accessor will be initialized with the pandas object
@@ -250,10 +254,6 @@ def plot(self):
250254
(5.0, 10.0)
251255
>>> ds.geo.plot()
252256
# plots data on a map
253-
254-
See Also
255-
--------
256-
%(others)s
257257
"""
258258

259259

pandas/core/groupby/groupby.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,14 @@ class GroupBy(_GroupBy):
976976
name : string
977977
Most users should ignore this
978978
979+
Returns
980+
-------
981+
**Attributes**
982+
groups : dict
983+
{group name -> group labels}
984+
len(grouped) : int
985+
Number of groups
986+
979987
Notes
980988
-----
981989
After grouping, see aggregate, apply, and transform functions. Here are
@@ -1009,14 +1017,6 @@ class GroupBy(_GroupBy):
10091017
10101018
See the online documentation for full exposition on these topics and much
10111019
more
1012-
1013-
Returns
1014-
-------
1015-
**Attributes**
1016-
groups : dict
1017-
{group name -> group labels}
1018-
len(grouped) : int
1019-
Number of groups
10201020
"""
10211021
def _bool_agg(self, val_test, skipna):
10221022
"""

pandas/core/resample.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ class Resampler(_GroupBy):
5151
kind : str or None
5252
'period', 'timestamp' to override default index treatement
5353
54-
Notes
55-
-----
56-
After resampling, see aggregate, apply, and transform functions.
57-
5854
Returns
5955
-------
6056
a Resampler of the appropriate type
57+
58+
Notes
59+
-----
60+
After resampling, see aggregate, apply, and transform functions.
6161
"""
6262

6363
# to the groupby descriptor

pandas/core/window.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,13 @@ def kurt(self, **kwargs):
12941294
Returned object type is determined by the caller of the %(name)s
12951295
calculation.
12961296
1297+
See Also
1298+
--------
1299+
pandas.Series.quantile : Computes value at the given quantile over all data
1300+
in Series.
1301+
pandas.DataFrame.quantile : Computes values at the given quantile over
1302+
requested axis in DataFrame.
1303+
12971304
Examples
12981305
--------
12991306
>>> s = pd.Series([1, 2, 3, 4])
@@ -1310,13 +1317,6 @@ def kurt(self, **kwargs):
13101317
2 2.5
13111318
3 3.5
13121319
dtype: float64
1313-
1314-
See Also
1315-
--------
1316-
pandas.Series.quantile : Computes value at the given quantile over all data
1317-
in Series.
1318-
pandas.DataFrame.quantile : Computes values at the given quantile over
1319-
requested axis in DataFrame.
13201320
""")
13211321

13221322
def quantile(self, quantile, interpolation='linear', **kwargs):

0 commit comments

Comments
 (0)