@@ -7383,7 +7383,7 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
7383
7383
.. deprecated:: 0.18.0
7384
7384
The new syntax is ``.resample(...).mean()``, or
7385
7385
``.resample(...).apply(<func>)``
7386
- axis : int, optional , default 0
7386
+ axis : {0 or 'index'} , default 0
7387
7387
Which axis to use for up- or down-sampling. For ``Series`` this
7388
7388
will default to 0, i.e. `along the rows`. Must be
7389
7389
``DatetimeIndex``, ``TimedeltaIndex`` or ``PeriodIndex``.
@@ -7543,42 +7543,50 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
7543
7543
For a Series with a PeriodIndex, the keyword `convention` can be
7544
7544
used to control whether to use the start or end of `rule`.
7545
7545
7546
+ Resample a year by quarter using 'start' `convention`. Values are
7547
+ assigned to the first quarter of the period.
7548
+
7546
7549
>>> s = pd.Series([1, 2], index=pd.period_range('2012-01-01',
7547
7550
... freq='A',
7548
7551
... periods=2))
7549
7552
>>> s
7550
7553
2012 1
7551
7554
2013 2
7552
7555
Freq: A-DEC, dtype: int64
7553
-
7554
- Resample by month using 'start' `convention`. Values are assigned to
7555
- the first month of the period.
7556
-
7557
- >>> s.resample('M', convention='start').asfreq().head()
7558
- 2012-01 1.0
7559
- 2012-02 NaN
7560
- 2012-03 NaN
7561
- 2012-04 NaN
7562
- 2012-05 NaN
7563
- Freq: M, dtype: float64
7564
-
7565
- Resample by month using 'end' `convention`. Values are assigned to
7566
- the last month of the period.
7567
-
7568
- >>> s.resample('M', convention='end').asfreq()
7569
- 2012-12 1.0
7570
- 2013-01 NaN
7571
- 2013-02 NaN
7572
- 2013-03 NaN
7573
- 2013-04 NaN
7574
- 2013-05 NaN
7575
- 2013-06 NaN
7576
- 2013-07 NaN
7577
- 2013-08 NaN
7578
- 2013-09 NaN
7579
- 2013-10 NaN
7580
- 2013-11 NaN
7581
- 2013-12 2.0
7556
+ >>> s.resample('Q', convention='start').asfreq()
7557
+ 2012Q1 1.0
7558
+ 2012Q2 NaN
7559
+ 2012Q3 NaN
7560
+ 2012Q4 NaN
7561
+ 2013Q1 2.0
7562
+ 2013Q2 NaN
7563
+ 2013Q3 NaN
7564
+ 2013Q4 NaN
7565
+ Freq: Q-DEC, dtype: float64
7566
+
7567
+ Resample quarters by month using 'end' `convention`. Values are
7568
+ assigned to the last month of the period.
7569
+
7570
+ >>> q = pd.Series([1, 2, 3, 4], index=pd.period_range('2018-01-01',
7571
+ ... freq='Q',
7572
+ ... periods=4))
7573
+ >>> q
7574
+ 2018Q1 1
7575
+ 2018Q2 2
7576
+ 2018Q3 3
7577
+ 2018Q4 4
7578
+ Freq: Q-DEC, dtype: int64
7579
+ >>> q.resample('M', convention='end').asfreq()
7580
+ 2018-03 1.0
7581
+ 2018-04 NaN
7582
+ 2018-05 NaN
7583
+ 2018-06 2.0
7584
+ 2018-07 NaN
7585
+ 2018-08 NaN
7586
+ 2018-09 3.0
7587
+ 2018-10 NaN
7588
+ 2018-11 NaN
7589
+ 2018-12 4.0
7582
7590
Freq: M, dtype: float64
7583
7591
7584
7592
For DataFrame objects, the keyword ``on`` can be used to specify the
0 commit comments