Skip to content

DOC: Fix order section in docstrings (part II) #24132

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

Merged
merged 6 commits into from
Dec 16, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
30 changes: 15 additions & 15 deletions pandas/_libs/interval.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ cdef class Interval(IntervalMixin):
Whether the interval is closed on the left-side, right-side, both or
neither. See the Notes for more detailed explanation.

See Also
--------
IntervalIndex : An Index of Interval objects that are all closed on the
same side.
cut : Convert continuous data into discrete bins (Categorical
of Interval objects).
qcut : Convert continuous data into bins (Categorical of Interval objects)
based on quantiles.
Period : Represents a period of time.

Notes
-----
The parameters `left` and `right` must be from the same type, you must be
Expand Down Expand Up @@ -226,16 +236,6 @@ cdef class Interval(IntervalMixin):
>>> volume_1 = pd.Interval('Ant', 'Dog', closed='both')
>>> 'Bee' in volume_1
True

See Also
--------
IntervalIndex : An Index of Interval objects that are all closed on the
same side.
cut : Convert continuous data into discrete bins (Categorical
of Interval objects).
qcut : Convert continuous data into bins (Categorical of Interval objects)
based on quantiles.
Period : Represents a period of time.
"""
_typ = "interval"

Expand Down Expand Up @@ -387,6 +387,11 @@ cdef class Interval(IntervalMixin):
bool
``True`` if the two intervals overlap, else ``False``.

See Also
--------
IntervalArray.overlaps : The corresponding method for IntervalArray
IntervalIndex.overlaps : The corresponding method for IntervalIndex

Examples
--------
>>> i1 = pd.Interval(0, 2)
Expand All @@ -409,11 +414,6 @@ cdef class Interval(IntervalMixin):
>>> i6 = pd.Interval(1, 2, closed='neither')
>>> i4.overlaps(i6)
False

See Also
--------
IntervalArray.overlaps : The corresponding method for IntervalArray
IntervalIndex.overlaps : The corresponding method for IntervalIndex
"""
if not isinstance(other, Interval):
msg = '`other` must be an Interval, got {other}'
Expand Down
16 changes: 8 additions & 8 deletions pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,10 @@ cdef class _Timedelta(timedelta):
-------
formatted : str

See Also
--------
Timestamp.isoformat

Notes
-----
The longest component is days, whose value may be larger than
Expand All @@ -1081,10 +1085,6 @@ cdef class _Timedelta(timedelta):
'P0DT0H0M10S'
>>> pd.Timedelta(days=500.5).isoformat()
'P500DT12H0MS'

See Also
--------
Timestamp.isoformat
"""
components = self.components
seconds = '{}.{:0>3}{:0>3}{:0>3}'.format(components.seconds,
Expand Down Expand Up @@ -1210,14 +1210,14 @@ class Timedelta(_Timedelta):
"""
Round the Timedelta to the specified resolution

Returns
-------
a new Timedelta rounded to the given resolution of `freq`

Parameters
----------
freq : a freq string indicating the rounding resolution

Returns
-------
a new Timedelta rounded to the given resolution of `freq`

Raises
------
ValueError if the freq cannot be converted
Expand Down
8 changes: 4 additions & 4 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -767,10 +767,6 @@ class Timestamp(_Timestamp):
"""
Round the Timestamp to the specified resolution

Returns
-------
a new Timestamp rounded to the given resolution of `freq`

Parameters
----------
freq : a freq string indicating the rounding resolution
Expand All @@ -793,6 +789,10 @@ class Timestamp(_Timestamp):

.. versionadded:: 0.24.0

Returns
-------
a new Timestamp rounded to the given resolution of `freq`

Raises
------
ValueError if the freq cannot be converted
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ def decorator(accessor):
Name under which the accessor should be registered. A warning is issued
if this name conflicts with a preexisting attribute.

See Also
--------
%(others)s

Notes
-----
When accessed, your accessor will be initialized with the pandas object
Expand Down Expand Up @@ -250,10 +254,6 @@ def plot(self):
(5.0, 10.0)
>>> ds.geo.plot()
# plots data on a map

See Also
--------
%(others)s
"""


Expand Down
16 changes: 8 additions & 8 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,14 @@ class GroupBy(_GroupBy):
name : string
Most users should ignore this

Returns
-------
**Attributes**
groups : dict
{group name -> group labels}
len(grouped) : int
Number of groups

Notes
-----
After grouping, see aggregate, apply, and transform functions. Here are
Expand Down Expand Up @@ -1010,14 +1018,6 @@ class GroupBy(_GroupBy):

See the online documentation for full exposition on these topics and much
more

Returns
-------
**Attributes**
groups : dict
{group name -> group labels}
len(grouped) : int
Number of groups
"""
def _bool_agg(self, val_test, skipna):
"""
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ class Resampler(_GroupBy):
kind : str or None
'period', 'timestamp' to override default index treatement

Notes
-----
After resampling, see aggregate, apply, and transform functions.

Returns
-------
a Resampler of the appropriate type

Notes
-----
After resampling, see aggregate, apply, and transform functions.
"""

# to the groupby descriptor
Expand Down
14 changes: 7 additions & 7 deletions pandas/core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,13 @@ def kurt(self, **kwargs):
Returned object type is determined by the caller of the %(name)s
calculation.

See Also
--------
pandas.Series.quantile : Computes value at the given quantile over all data
in Series.
pandas.DataFrame.quantile : Computes values at the given quantile over
requested axis in DataFrame.

Examples
--------
>>> s = pd.Series([1, 2, 3, 4])
Expand All @@ -1310,13 +1317,6 @@ def kurt(self, **kwargs):
2 2.5
3 3.5
dtype: float64

See Also
--------
pandas.Series.quantile : Computes value at the given quantile over all data
in Series.
pandas.DataFrame.quantile : Computes values at the given quantile over
requested axis in DataFrame.
""")

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