Skip to content

Conversation

@jtratner
Copy link
Contributor

There's a lot of overlap right now, this is the first step to trying to
make this cleaner.

  • Abstract all arithmetic methods into core/ops
  • Add full range of flex arithmetic methods to all NDFrame/ndarray
    PandasObjects (except for SparsePanel pow and mod, which only work for
    scalars)
  • Normalize arithmetic methods signature (see
    ops.add_special_arithmetic_methods and
    ops.add_flex_arithmetic_methods for signature).
  • Opt-in more arithmetic operations with numexpr (except for
    SparsePanel, which has to opt-out because it doesn't respond to
    shape).
  • BUG: Fix _fill_zeros call to work even if TypeError (previously
    was inconsistent).
  • Add bind method to core/common

Closes #3765.
Closes #4334.
Closes #4051.
Closes #5033.
Closes #4331.

@jtratner
Copy link
Contributor Author

This could use more work later on, but this is a nightmare to maintain in the interim, so I'd like to put it into pandas. Comments?

Copy link
Contributor

Choose a reason for hiding this comment

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

was this a string editing? because its already there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

darn it git.

@jtratner
Copy link
Contributor Author

To be clear, basically the only changes in functionality in this PR are:

  • Series and Panel use numexpr sometimes
  • change to the signature for arithmetic methods
  • add a few more flex methods.

Copy link
Member

Choose a reason for hiding this comment

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

can u keep my change here from the parse-exceptions PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was one place I made an explicit choice. I'm okay either way (I had this error before) - thought it was helpful to print the lengths with the exception. your call.

Copy link
Member

Choose a reason for hiding this comment

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

i'm just referring to the ugly not ((len(self) == len(other))), your error message is much better

@jtratner
Copy link
Contributor Author

@cpcloud @jreback any last fixes? Again, these are relatively minimal changes, aside from moving functions.

@cpcloud
Copy link
Member

cpcloud commented Sep 29, 2013

ok by me.

@jreback
Copy link
Contributor

jreback commented Sep 29, 2013

ok here too

* Abstract all arithmetic methods into core/ops
* Normalize arithmetic methods signature (see
  `ops.add_special_arithmetic_methods` and `ops.add_flex_arithmetic_methods`
  for signature).
* Opt-in more arithmetic operations with numexpr (except for
  SparsePanel, which has to opt-out because it doesn't respond to
  `shape`).
* BUG: Fix ``_fill_zeros`` call to work even if TypeError (previously
  was inconsistent).
* Add bind method to core/common
* Add full range of flex arithmetic methods to all NDFrame/ndarray
  PandasObjects (except for SparsePanel pow and mod, which only work for
  scalars)
* Add a set of testing methods to check that numexpr was actually used
  successfully.
* Flesh out test cases to include all arithmetic ops + test refactoring
* Disable numexpr for sparse objects (they don't work correctly right
* now)
* Sparse methods aren't moved because they are very specific to sparse
  (and aren't numexpr accelerated)
* Disable r* comparisons for now because they cause test failures
* Specifically allow radd in TimeOps for Series
* Fixup Series time rops and add a few test cases.
* Disable flex r-ops for bools (no good test cases yet...)
* TST: Remove tests for TypeErrors in pandas/computation/test_eval that
  now work after this refactor (because DataFrame now defines more r*
  methods)
Enable test cases that involve these DateOffsets with `__r*` ops
jtratner added a commit that referenced this pull request Sep 29, 2013
CLN/ENH: Provide full suite of arithmetic (and flex) methods to all NDFrame objects.
@jtratner jtratner merged commit a58bc6a into pandas-dev:master Sep 29, 2013
@jtratner jtratner deleted the arithmetic-refactor2 branch September 29, 2013 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants