-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Improved the docstring of pandas.Series.truncate #20125
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
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6888,29 +6888,33 @@ def tshift(self, periods=1, freq=None, axis=0): | |
|
||
def truncate(self, before=None, after=None, axis=None, copy=True): | ||
""" | ||
Truncates a sorted DataFrame/Series before and/or after some | ||
particular index value. If the axis contains only datetime values, | ||
Truncate a DataFrame/Series before/after some index value. | ||
|
||
If the axis contains only datetime values, | ||
before/after parameters are converted to datetime values. | ||
|
||
Parameters | ||
---------- | ||
before : date, string, int | ||
Truncate all rows before this index value | ||
Truncate all rows before this index value. | ||
after : date, string, int | ||
Truncate all rows after this index value | ||
Truncate all rows after this index value. | ||
axis : {0 or 'index', 1 or 'columns'} | ||
|
||
* 0 or 'index': apply truncation to rows | ||
* 1 or 'columns': apply truncation to columns | ||
|
||
Default is stat axis for given data type (0 for Series and | ||
DataFrames, 1 for Panels) | ||
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. you can remove the default for Panel 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. done thanks! |
||
DataFrames). | ||
copy : boolean, default is True, | ||
return a copy of the truncated section | ||
Return a copy of the truncated section. | ||
|
||
Returns | ||
------- | ||
truncated : type of caller | ||
type of caller | ||
The truncated DataFrame/Series. | ||
|
||
See Also | ||
-------- | ||
DataFrame.truncate : Truncate a DataFrame before/after some index | ||
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. we don't have these defined in Series/DataFrame, so not sure these can be here @jorisvandenbossche 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. Yes, since the docstring is shared for both Series and DataFrame, those "see also" are referring to themselves. So indeed not needed in this case (and you ignore the error in the validation script about missing "See Also") |
||
value. | ||
Series.truncate : Truncate a Series before/after some index value. | ||
|
||
Examples | ||
-------- | ||
|
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.
I think this list was still informative? So I would keep it.