-
-
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 1 commit
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 |
---|---|---|
|
@@ -979,6 +979,7 @@ def __copy__(self, **kwargs): | |
return self.copy(**kwargs) | ||
|
||
def __deepcopy__(self, memo=None): | ||
# TODO: memo is unused | ||
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. this is a standard signature, so maybe add a doc-string, you don't need to pass thru memo |
||
if memo is None: | ||
memo = {} | ||
return self.copy(deep=True) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -479,7 +479,6 @@ 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) | ||
|
||
mask = isna(values) | ||
if not is_float_dtype(values.dtype): | ||
|
@@ -635,7 +634,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,6 +2478,7 @@ def sort_values(self, axis=0, ascending=True, inplace=False, | |
dtype: object | ||
""" | ||
inplace = validate_bool_kwarg(inplace, 'inplace') | ||
# TODO: axis is unused, is this just validation? | ||
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. these are checked, so you don't need to assign |
||
axis = self._get_axis_number(axis) | ||
|
||
# GH 5856/5853 | ||
|
@@ -2651,6 +2651,7 @@ 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 |
||
# TODO: axis is unused, is this just validation? | ||
axis = self._get_axis_number(axis) | ||
index = self.index | ||
|
||
|
@@ -3072,6 +3073,7 @@ def _gotitem(self, key, ndim, subset=None): | |
versionadded='.. versionadded:: 0.20.0', | ||
**_shared_doc_kwargs)) | ||
def aggregate(self, func, axis=0, *args, **kwargs): | ||
# TODO: axis is unused, is this just validation? | ||
axis = self._get_axis_number(axis) | ||
result, how = self._aggregate(func, *args, **kwargs) | ||
if result is None: | ||
|
@@ -3918,7 +3920,7 @@ def dropna(self, axis=0, inplace=False, **kwargs): | |
if kwargs: | ||
raise TypeError('dropna() got an unexpected keyword ' | ||
'argument "{0}"'.format(list(kwargs.keys())[0])) | ||
|
||
# TODO: axis is unused, is this just validation? | ||
axis = self._get_axis_number(axis or 0) | ||
|
||
if self._can_hold_na: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -496,6 +496,8 @@ def _chk_truncate(self): | |
self.tr_col_num = col_num | ||
if truncate_v: | ||
if max_rows_adj == 0: | ||
# TODO: Should the next block be elif? row_num here will | ||
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. this is fine |
||
# be overwritten. | ||
row_num = len(frame) | ||
if max_rows_adj == 1: | ||
row_num = max_rows | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -547,6 +547,7 @@ def _get_object_parser(self, json): | |
|
||
if typ == 'series' or obj is None: | ||
if not isinstance(dtype, bool): | ||
# TODO: dtype is unused. Should this be an update on kwargs? | ||
dtype = dict(data=dtype) | ||
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. If we can find an example that breaks because of this unused variable, that would be good for another PR. 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. FYI, comment applies to many of the other variables in which you questioned whether it actually should be used, but previous authors didn't get around to implementing functionality with it. |
||
obj = SeriesParser(json, **kwargs).parse() | ||
|
||
|
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 suspect the answer is yes, in which case, not assigning the variable is fine.