-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
CLN: remove never-used branch from Series ops #27236
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/ops.py
Outdated
@@ -1713,10 +1713,6 @@ def na_op(x, y): | |||
result = expressions.evaluate(op, str_rep, x, y, **eval_kwargs) | |||
except TypeError: | |||
result = masked_arith_op(x, y, op) | |||
except Exception: # TODO: more specific? |
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 seems to be the only usage, let's remove arrmap_object as well
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.
ahh I c, this is parametrized, ok then.
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.
actually do we use arrmap_*
anywhere?
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.
-revising again; looks like we can completely remove arrmap_*-
nope looks like 1 usage (after you remove this one)
(pandas) bash-3.2$ grep -r arrmap_ pandas --include '*.py'
pandas/core/algorithms.py: return algos.arrmap_float64(q, _get_score)
pandas/core/ops.py: return libalgos.arrmap_object(x, lambda val: op(val, y))
pandas/tests/test_algos.py: result = libalgos.arrmap_object(values, lambda x: x in ["foo", "bar"])
(pandas) bash-3.2$ grep -r arrmap_ pandas --include '*.pyx'
pandas/_libs/algos.pyx:arrmap_float64 = arrmap["float64_t"]
pandas/_libs/algos.pyx:arrmap_float32 = arrmap["float32_t"]
pandas/_libs/algos.pyx:arrmap_object = arrmap["object"]
pandas/_libs/algos.pyx:arrmap_int64 = arrmap["int64_t"]
pandas/_libs/algos.pyx:arrmap_int32 = arrmap["int32_t"]
pandas/_libs/algos.pyx:arrmap_uint64 = arrmap["uint64_t"]
pandas/_libs/algos.pyx:arrmap_bool = arrmap["uint8_t"]
So what's the conclusion re arrmap_*? |
pandas/core/algorithms.py
I think you can just do |
I'll open an issue to look into this more carefully. |
cool, ping on green. |
ping |
thanks @jbrockmendel |
Almost gets to a point where Series and DataFrame ops can share the na_op definition.
AFAICT this is the only non-test usage of libalgos.arrmap_object.