Skip to content

Commit abb2b58

Browse files
committed
DOC: Address latest PR comments (pandas-dev#22894)
1 parent ce7886a commit abb2b58

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

pandas/core/generic.py

+19-17
Original file line numberDiff line numberDiff line change
@@ -7369,9 +7369,9 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
73697369
Resample time-series data.
73707370
73717371
Convenience method for frequency conversion and resampling of time
7372-
series. Object must have a datetime-like index (``DatetimeIndex``,
7373-
``PeriodIndex``, or ``TimedeltaIndex``), or pass datetime-like values
7374-
to the ``on`` or ``level`` keyword.
7372+
series. Object must have a datetime-like index (`DatetimeIndex`,
7373+
`PeriodIndex`, or `TimedeltaIndex`), or pass datetime-like values
7374+
to the `on` or `level` keyword.
73757375
73767376
Parameters
73777377
----------
@@ -7383,10 +7383,10 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
73837383
.. deprecated:: 0.18.0
73847384
The new syntax is ``.resample(...).mean()``, or
73857385
``.resample(...).apply(<func>)``
7386-
axis : {0 or 'index'}, default 0
7387-
Which axis to use for up- or down-sampling. For ``Series`` this
7388-
will default to 0, i.e. `along the rows`. Must be
7389-
``DatetimeIndex``, ``TimedeltaIndex`` or ``PeriodIndex``.
7386+
axis : {0 or 'index', 1 or 'columns'}, default 0
7387+
Which axis to use for up- or down-sampling. For `Series` this
7388+
will default to 0, i.e. along the rows. Must be
7389+
`DatetimeIndex`, `TimedeltaIndex` or `PeriodIndex`.
73907390
fill_method : str, default None
73917391
Filling method for upsampling.
73927392
@@ -7402,16 +7402,16 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
74027402
for all frequency offsets except for 'M', 'A', 'Q', 'BM',
74037403
'BA', 'BQ', and 'W' which all have a default of 'right'.
74047404
convention : {'start', 'end', 's', 'e'}, default 'start'
7405-
For ``PeriodIndex`` only, controls whether to use the start or
7406-
end of ``rule``.
7405+
For `PeriodIndex` only, controls whether to use the start or
7406+
end of `rule`.
74077407
kind : {'timestamp', 'period'}, optional, default None
74087408
Pass 'timestamp' to convert the resulting index to a
7409-
``DateTimeIndex`` or 'period' to convert it to a ``PeriodIndex``.
7409+
`DateTimeIndex` or 'period' to convert it to a `PeriodIndex`.
74107410
By default the input representation is retained.
74117411
loffset : timedelta, default None
74127412
Adjust the resampled time labels.
74137413
limit : int, default None
7414-
Maximum size gap when reindexing with ``fill_method``.
7414+
Maximum size gap when reindexing with `fill_method`.
74157415
74167416
.. deprecated:: 0.18.0
74177417
base : int, default 0
@@ -7426,7 +7426,7 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
74267426
74277427
level : str or int, optional
74287428
For a MultiIndex, level (name or number) to use for
7429-
resampling. ``level`` must be datetime-like.
7429+
resampling. `level` must be datetime-like.
74307430
74317431
.. versionadded:: 0.19.0
74327432
@@ -7446,6 +7446,8 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
74467446
See Also
74477447
--------
74487448
groupby : Group by mapping, function, label, or list of labels.
7449+
Series.resample : Resample a Series.
7450+
DataFrame.resample: Resample a DataFrame.
74497451
74507452
Examples
74517453
--------
@@ -7544,10 +7546,10 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
75447546
2000-01-01 00:06:00 26
75457547
Freq: 3T, dtype: int64
75467548
7547-
For a Series with a PeriodIndex, the keyword ``convention`` can be
7549+
For a Series with a PeriodIndex, the keyword `convention` can be
75487550
used to control whether to use the start or end of `rule`.
75497551
7550-
Resample a year by quarter using 'start' ``convention``. Values are
7552+
Resample a year by quarter using 'start' `convention`. Values are
75517553
assigned to the first quarter of the period.
75527554
75537555
>>> s = pd.Series([1, 2], index=pd.period_range('2012-01-01',
@@ -7568,7 +7570,7 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
75687570
2013Q4 NaN
75697571
Freq: Q-DEC, dtype: float64
75707572
7571-
Resample quarters by month using 'end' ``convention``. Values are
7573+
Resample quarters by month using 'end' `convention`. Values are
75727574
assigned to the last month of the period.
75737575
75747576
>>> q = pd.Series([1, 2, 3, 4], index=pd.period_range('2018-01-01',
@@ -7593,7 +7595,7 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
75937595
2018-12 4.0
75947596
Freq: M, dtype: float64
75957597
7596-
For DataFrame objects, the keyword ``on`` can be used to specify the
7598+
For DataFrame objects, the keyword `on` can be used to specify the
75977599
column instead of the index for resampling.
75987600
75997601
>>> d = dict({'price': [10, 11, 9, 13, 14, 18, 17, 19],
@@ -7618,7 +7620,7 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
76187620
2018-01-31 10.75 62.5
76197621
2018-02-28 17.00 60.0
76207622
7621-
For a DataFrame with MultiIndex, the keyword ``level`` can be used to
7623+
For a DataFrame with MultiIndex, the keyword `level` can be used to
76227624
specify on which level the resampling needs to take place.
76237625
76247626
>>> days = pd.date_range('1/1/2000', periods=4, freq='D')

0 commit comments

Comments
 (0)