Skip to content

DOC: update the pandas.DataFrame.clip docstring #20212

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

Closed
wants to merge 25 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docstring for pandas.DataFrame.clip
  • Loading branch information
Dpananos committed Mar 10, 2018
commit 1371a237c247983e1d3a8875d79dbb9677e9a69f
4 changes: 4 additions & 0 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5607,7 +5607,11 @@ def clip(self, lower=None, upper=None, axis=None, inplace=False,
Parameters
----------
lower : float or array_like, default None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it's better or worse, but I think the standard we defined is to use float, array-like or None, default None (so the None is duplicated). Also note the hyphen and not underscore in array-like

Lower threshold for clipping. Values smaller than upper will be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For naming parameters it's better to have them in backticks. In this case I think it adds value, making it clearer that upper is a parameter (and lower).

converted to lower.
upper : float or array_like, default None
Upper threshold for clipping. Values larger than upper will be
converted to upper.
axis : int or string axis name, optional
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We added a standard for axis to the documentation, at the end of the Paramters section. Basically it's axis : {0 or 'index', 1 or 'columns', None}, default None

Align object with lower and upper along the given axis.
inplace : boolean, default False
Expand Down