-
-
Notifications
You must be signed in to change notification settings - Fork 19.5k
DEPR: DataFrame dropna accepting multiple axes #20995
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 |
|---|---|---|
|
|
@@ -4168,14 +4168,14 @@ def dropna(self, axis=0, how='any', thresh=None, subset=None, | |
|
|
||
| Parameters | ||
| ---------- | ||
| axis : {0 or 'index', 1 or 'columns'}, or tuple/list thereof | ||
| axis : {0 or 'index', 1 or 'columns'} | ||
|
||
| Determine if rows or columns which contain missing values are | ||
| removed. | ||
|
|
||
| * 0, or 'index' : Drop rows which contain missing values. | ||
| * 1, or 'columns' : Drop columns which contain missing value. | ||
|
|
||
| Pass tuple or list to drop on multiple axes. | ||
| deprecated:: 0.23.0: Pass tuple or list to drop on multiple axes. | ||
|
||
| how : {'any', 'all'}, default 'any' | ||
| Determine if row or column is removed from DataFrame, when we have | ||
| at least one NA or all NA. | ||
|
|
@@ -4259,6 +4259,11 @@ def dropna(self, axis=0, how='any', thresh=None, subset=None, | |
| """ | ||
| inplace = validate_bool_kwarg(inplace, 'inplace') | ||
| if isinstance(axis, (tuple, list)): | ||
| # GH20987 | ||
| msg = ("supplying multiple axes to axis is deprecated and " | ||
| "will be removed in a future version.") | ||
| warnings.warn(msg, FutureWarning, stacklevel=2) | ||
|
|
||
| result = self | ||
| for ax in axis: | ||
| result = result.dropna(how=how, thresh=thresh, subset=subset, | ||
|
|
||
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.
Small typo of "supported"
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.
Thanks!