-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
ENH: Use numexpr for all arithmetic operators + refactor arithmetic operations #4051
ENH: Use numexpr for all arithmetic operators + refactor arithmetic operations #4051
Conversation
I can combine a few of the commits if necessary ... just wanted to make the progression clearer. |
This is great. Numexpr ftw. |
yay ... another network error :-/ |
fixes r on the way |
moving at the speed of travis :| |
well, I realized I missed testing the entire set of arithmetic methods in the individual cases (outside of test_expressions), so I guess it's okay. Btw - is it worth it to mark the panel tests as slow in expressions if they add 1.5s to the total suite? |
(1.5s total) |
Is it a single test? If so yes else no |
no, it's not. |
Now evaluate takes eval_kwargs (generally just truediv) to numexpr.evaluate plus adds a set of testing methods to check that numexpr was actually used successfully. Also changes the if hasattr idiom --> getattr.
Adds a better error for ``isinstance`` checks as well as a better error message for the ``isnull`` case.
Makes the entire arithmetic test suite explicit as well as sets up test cases to make sure the default_axis responses do not change.
BUG: Fix ``_fill_zeros`` call to work even if TypeError (previously was inconsistent).
SparsePanel has to opt-out because it doesn't respond to ``shape``. ENH: Add flex comparison methods to Series and Panel
@jtratner this real nice.. not that I think ops actually make much sense on a |
@jreback okay, will do. |
@@ -326,18 +329,35 @@ def _flex_method(op, name): | |||
------- | |||
result : Series | |||
""" % name | |||
# copied directly from _arith_method above...we'll see whether this works | |||
def na_op(x, y): |
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.
completely random
do you think its possible to consolidate these arithmetic ops out of series/frame/panel and move to say ops.py
(they still prob need to be separate but maybe can somewhat be combined)....
I am refereing to the actual methods, e.g. _flex_method
and the sub-functions na_op
just a thought
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 was definitely thinking of this. It's possible that much of series and
frame could be combined. I'll explore.
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.
gr8......I would STILL be inclined to keep them separate as it reduces code complexity but there may be some easily fixed stuff (though +1 to move to say ops.py)
oh awesome. I'll definitely do that. On Fri, Jul 19, 2013 at 9:08 PM, jreback notifications@github.com wrote:
|
you can push, just DONT rebase |
@jreback good to know. |
@jtratner after I update #3482 / #4324 I think it would be appropriate to use part of this PR, namely which moved the arithmetic/comp ops to generic.py to cover all of NDFrame (as Series will then inherit too), e.g. your the numexpr stuff can be done separately (after) |
Yeah, I agree with you on that. Adding numexpr speedup is trivial compared To be clear: do you want me to make a PR and/or push some of these changes
|
I think that eval-3393 is pretty independent of the series refactor. what you can do if you want is make a new PR on top of series #3482 (or do after I have merged). The numexpr stuff let's do after both of these PR's are in in your artihmetic/comparison changes. |
Makes sense |
@jreback should probably merge series first then eval...i'll rebase after that merge and then test again to make sure things are working correctly....but shouldn't really matter that much |
Now that I think about it, separating out the numexpr part will make this way easier to apply on top of that PR. |
Closing as per @jreback 's suggestion and will split into two separate PRs. |
Resolves #3765.
This is going to be split into two parts and then rebased on top of #3482.
Tasks:
ops.py
).This adds:
Series
,Panel
,Panel4D
, andDataFrame
(SparsePanel
has to opt-out b/c doesn't respond to shape)Series
,Panel
,Panel4D
,DataFrame
,SparsePanel
support the entire range of arithmetic operators [previously some were missing].@cpcloud - I think this would be very easy to add into your current changes with eval. (mostly just changes
if hasattr
-->getattr
to be cleaner).