Skip to content

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

Merged
merged 3 commits into from
Jul 5, 2019

Conversation

jbrockmendel
Copy link
Member

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.

@@ -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?
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

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?

@jreback jreback added Clean Internals Related to non-user accessible pandas implementation labels Jul 5, 2019
@jreback jreback added this to the 0.25.0 milestone Jul 5, 2019
Copy link
Contributor

@jreback jreback left a 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"]

@jbrockmendel
Copy link
Member Author

So what's the conclusion re arrmap_*?

@jreback
Copy link
Contributor

jreback commented Jul 5, 2019

pandas/core/algorithms.py

        q = np.asarray(q, np.float64)
        return algos.arrmap_float64(q, _get_score)

I think you can just do np.vectorize on this and it will work, if so, then let's completely blow away arrmap

@jbrockmendel
Copy link
Member Author

I'll open an issue to look into this more carefully.

@jreback
Copy link
Contributor

jreback commented Jul 5, 2019

cool, ping on green.

@jbrockmendel
Copy link
Member Author

ping

@jreback jreback merged commit de006f8 into pandas-dev:master Jul 5, 2019
@jreback
Copy link
Contributor

jreback commented Jul 5, 2019

thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the objs branch July 5, 2019 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants