-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Remove unused variables #21986
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
CLN: Remove unused variables #21986
Changes from 4 commits
966d79a
a154bf5
b908aff
234984a
82683e5
d5ddbc1
0d7f077
8492e93
8a4f531
05e4a36
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 |
---|---|---|
|
@@ -479,7 +479,9 @@ def nanvar(values, axis=None, skipna=True, ddof=1): | |
|
||
@disallow('M8', 'm8') | ||
def nansem(values, axis=None, skipna=True, ddof=1): | ||
var = nanvar(values, axis, skipna, ddof=ddof) | ||
# This checks if non-numeric-like data is passed with numeric_only=False | ||
# and raises a TypeError otherwise | ||
nanvar(values, axis, skipna, ddof=ddof) | ||
|
||
mask = isna(values) | ||
if not is_float_dtype(values.dtype): | ||
|
@@ -635,7 +637,6 @@ def nankurt(values, axis=None, skipna=True): | |
adj = 3 * (count - 1) ** 2 / ((count - 2) * (count - 3)) | ||
numer = count * (count + 1) * (count - 1) * m4 | ||
denom = (count - 2) * (count - 3) * m2**2 | ||
result = numer / denom - adj | ||
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. huh? is not used? 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 this not used? |
||
|
||
# floating point error | ||
# | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2051,7 +2051,6 @@ def dot(self, other): | |
lvals = left.values | ||
rvals = right.values | ||
else: | ||
left = self | ||
lvals = self.values | ||
rvals = np.asarray(other) | ||
if lvals.shape[0] != rvals.shape[0]: | ||
|
@@ -2479,7 +2478,8 @@ def sort_values(self, axis=0, ascending=True, inplace=False, | |
dtype: object | ||
""" | ||
inplace = validate_bool_kwarg(inplace, 'inplace') | ||
axis = self._get_axis_number(axis) | ||
# Valida the axis parameter | ||
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. Validate typo |
||
self._get_axis_number(axis) | ||
|
||
# GH 5856/5853 | ||
if inplace and self._is_cached: | ||
|
@@ -2651,7 +2651,8 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False, | |
# TODO: this can be combined with DataFrame.sort_index impl as | ||
# almost identical | ||
inplace = validate_bool_kwarg(inplace, 'inplace') | ||
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. same with all of these |
||
axis = self._get_axis_number(axis) | ||
# Valida the axis parameter | ||
self._get_axis_number(axis) | ||
index = self.index | ||
|
||
if level is not None: | ||
|
@@ -3072,7 +3073,8 @@ def _gotitem(self, key, ndim, subset=None): | |
versionadded='.. versionadded:: 0.20.0', | ||
**_shared_doc_kwargs)) | ||
def aggregate(self, func, axis=0, *args, **kwargs): | ||
axis = self._get_axis_number(axis) | ||
# Valida the axis parameter | ||
self._get_axis_number(axis) | ||
result, how = self._aggregate(func, *args, **kwargs) | ||
if result is None: | ||
|
||
|
@@ -3918,8 +3920,8 @@ def dropna(self, axis=0, inplace=False, **kwargs): | |
if kwargs: | ||
raise TypeError('dropna() got an unexpected keyword ' | ||
'argument "{0}"'.format(list(kwargs.keys())[0])) | ||
|
||
axis = self._get_axis_number(axis or 0) | ||
# Valida the axis parameter | ||
self._get_axis_number(axis or 0) | ||
|
||
if self._can_hold_na: | ||
result = remove_na_arraylike(self) | ||
|
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.
We’re there cases before where the wrong thing was passed? I.e. None != ordered != self.ordered?
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.
is this tested anywhere? I agree this should have broken things
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.
It appears that all instances of this private method
_create_from_codes
in the codebase never passed an arg toordered
(i.e.ordered
always defaulted toNone
which always got reassigned toself.ordered
here)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.