Skip to content

Commit 49714e8

Browse files
author
tp
committed
add links to groupby/resample doc strings
1 parent 331e8f9 commit 49714e8

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

doc/source/groupby.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,8 @@ code more readable. First we set the data:
12301230
import numpy as np
12311231
n = 1000
12321232
df = pd.DataFrame({'Store': np.random.choice(['Store_1', 'Store_2'], n),
1233-
'Product': np.random.choice(['Product_1','Product_2'], n),
1233+
'Product': np.random.choice(['Product_1',
1234+
'Product_2'], n),
12341235
'Revenue': (np.random.random(n)*50+10).round(2),
12351236
'Quantity': np.random.randint(1, 10, size=n)})
12361237
df.head(2)

pandas/core/generic.py

+24-3
Original file line numberDiff line numberDiff line change
@@ -5561,6 +5561,10 @@ def groupby(self, by=None, axis=0, level=None, as_index=True, sort=True,
55615561
reduce the dimensionality of the return type if possible,
55625562
otherwise return a consistent type
55635563
5564+
Returns
5565+
-------
5566+
GroupBy object
5567+
55645568
Examples
55655569
--------
55665570
DataFrame results
@@ -5572,10 +5576,15 @@ def groupby(self, by=None, axis=0, level=None, as_index=True, sort=True,
55725576
55735577
>>> data.groupby(['col1', 'col2']).mean()
55745578
5575-
Returns
5576-
-------
5577-
GroupBy object
5579+
Notes
5580+
-----
5581+
See the `user guide
5582+
<http://pandas.pydata.org/pandas-docs/stable/groupby.html>`_ for more.
55785583
5584+
See also
5585+
--------
5586+
resample : Convenience method for frequency conversion and resampling
5587+
of time series.
55795588
"""
55805589
from pandas.core.groupby import groupby
55815590

@@ -5774,8 +5783,16 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
57745783
57755784
.. versionadded:: 0.19.0
57765785
5786+
Returns
5787+
-------
5788+
Resampler object
5789+
57775790
Notes
57785791
-----
5792+
See the `user guide
5793+
<http://pandas.pydata.org/pandas-docs/stable/timeseries.html#resampling>`_
5794+
for more.
5795+
57795796
To learn more about the offset strings, please see `this link
57805797
<http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases>`__.
57815798
@@ -5941,6 +5958,10 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
59415958
a b c d
59425959
2000-01-01 00:00:00 0 6 12 18
59435960
2000-01-01 00:03:00 0 4 8 12
5961+
5962+
See also
5963+
--------
5964+
groupby : Group by mapping, function, label, or list of labels.
59445965
"""
59455966
from pandas.core.resample import (resample,
59465967
_maybe_process_deprecations)

0 commit comments

Comments
 (0)