-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
DOC: update pandas.core.groupby.DataFrameGroupBy.resample docstring. #20374
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
Changes from 1 commit
59355d6
deea3c7
2fcabf7
fdce932
4b55b5f
e7905b2
a0c5329
4880d3b
084ac39
73b480b
f375ceb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1294,13 +1294,11 @@ def describe(self, **kwargs): | |
return result.T | ||
return result.unstack() | ||
|
||
@Substitution(name='groupby') | ||
@Appender(_doc_template) | ||
def resample(self, rule, *args, **kwargs): | ||
""" | ||
Provide resampling when using a TimeGrouper. | ||
|
||
Given a grouper the function resamples it according to a string | ||
Given a grouper, the function resamples it according to a string | ||
"string" -> "frequency". | ||
|
||
See the :ref:`frequency aliases <timeseries.offset-aliases>` | ||
|
@@ -1310,15 +1308,16 @@ def resample(self, rule, *args, **kwargs): | |
---------- | ||
rule : str or Offset | ||
The offset string or object representing target grouper conversion. | ||
*args, **kwargs : [closed, label, loffset] | ||
For compatibility with other groupby methods. See below for some | ||
example parameters. | ||
closed : {‘right’, ‘left’} | ||
Which side of bin interval is closed. | ||
label : {‘right’, ‘left’} | ||
Which bin edge label to label bucket with. | ||
loffset : timedelta | ||
Adjust the resampled time labels. | ||
*args, **kwargs | ||
For compatibility with other groupby methods. Available keywor | ||
arguments are: | ||
datapythonista marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* closed : {'right', 'left'} | ||
Which side of bin interval is closed. | ||
* label : {'right', 'left'} | ||
Which bin edge label to label bucket with. | ||
* loffset : timedelta | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is "loffset" right? I don't know this section of the code all that well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not an expert myself, I guess the type should be For what I can see, valid keywords should be What I'd do is to add the ones from @jreback is it ok to change the signature? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pandres can you replace the description by something like:
We can improve that later in a separate PR, but I think we can merge all the rest of the changes for now. Thanks! |
||
Adjust the resampled time labels. | ||
|
||
Returns | ||
------- | ||
|
@@ -1327,15 +1326,13 @@ def resample(self, rule, *args, **kwargs): | |
|
||
See Also | ||
-------- | ||
pandas.Grouper : specify a frequency to resample with when | ||
pandas.Grouper : Specify a frequency to resample with when | ||
grouping by a key. | ||
DatetimeIndex.resample : Frequency conversion and resampling of | ||
time series. | ||
|
||
Examples | ||
-------- | ||
Start by creating a length-4 DataFrame with minute frequency. | ||
|
||
>>> idx = pd.date_range('1/1/2000', periods=4, freq='T') | ||
>>> df = pd.DataFrame(data=4 * [range(2)], | ||
... index=idx, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Offset --> DateOffset