Skip to content

BUG/CLN: numpy compat with pandas numeric functions and cln of same (GH4435) #5034

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 4 commits into from
Sep 29, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Sep 29, 2013

related #4787 (keywords now pass thru to _reduce), default for numeric is still None

closes #4435

BUG: provide numpy compatibility with 1.7 when implicity using __array__, IOW:

np.prod(s), or np.mean(df,axis=1) will now work (because numpy decided to try to see if the
object has this function and then pass all kinds of keywords to it, so pandas gets the right function called
with dtype, and out passed in (currently ignored)

CLN: refactored all numeric and stat like function (sum/mean/mad/min/max) and cums (cummin/sum..)

to core/generic.py from Series/DataFrame/Panel

@jreback
Copy link
Contributor Author

jreback commented Sep 29, 2013

first PR with big deleted loc!

@jreback
Copy link
Contributor Author

jreback commented Sep 29, 2013

@jtratner don't worry....going to wait for your big ops merger first! (though I don't think much will conflic)

@jtratner
Copy link
Contributor

@jreback I know, nice to finally see something decrease the size of the codebase. Arithmetic refactor ended up about even if you exclude tests and docs changes.

@@ -1207,89 +1208,11 @@ def f(self, other, axis=0):
return self._combine(other, na_op, axis=axis)
f.__name__ = name
return f

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtratner should this _panel_arith_method be from core/ops.py? (I tried to use ops._arith_method_PANEL) which seemed very similar (though w/o the doc string creation) and it broke a small number of tests, so using this one

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't clear on this so I didn't touch it, we could probably move it eventually.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np...thxs

jreback added a commit that referenced this pull request Sep 29, 2013
BUG/CLN: numpy compat with pandas numeric functions and cln of same (GH4435)
@jreback jreback merged commit b3fee7c into pandas-dev:master Sep 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

COMPAT: numpy compat with array methods in >= 1.7
2 participants