-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REF/TYP: define methods non-dynamically for SparseArray #36943
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
Conversation
pandas/core/arrays/sparse/array.py
Outdated
fill_value = op(self.fill_value, other) | ||
result = op(self.sp_values, other) | ||
@unpack_zerodim_and_defer("__and__") | ||
def __and__(self, other) -> "SparseArray": |
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.
with #36964 merged, can these now be removed?
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.
yes, updated
pandas/core/arrays/sparse/array.py
Outdated
return compat.set_function_name(cmp_method, name, cls) | ||
@unpack_zerodim_and_defer("__xor__") | ||
def __xor__(self, other) -> "SparseArray": | ||
return self._logical_method(other, operator.xor) |
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.
this was using _create_arithmetic_method b4 whereas and
and or
were using _create_comparison_method. Any user facing changes?
@@ -796,7 +795,6 @@ def __getitem__(self, key): | |||
key = check_array_indexer(self, key) | |||
|
|||
if com.is_bool_indexer(key): | |||
key = check_bool_indexer(self, key) |
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.
not needed?
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff