Skip to content

BUG: Bug in expressions evaluation with reversed ops, showing in series-dataframe ops (GH7198) #7201

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 1 commit into from
May 21, 2014

Conversation

jreback
Copy link
Contributor

@jreback jreback commented May 21, 2014

closes #7198
closes #7192

@jreback jreback added this to the 0.14.0 milestone May 21, 2014
@jreback
Copy link
Contributor Author

jreback commented May 21, 2014

@cpcloud this is fine in 0.13.1 and broke in 0.14.0...any clue?

@jreback
Copy link
Contributor Author

jreback commented May 21, 2014

I think this is the same issues as in #7192 (as the subtraction is not commutative)

@cpcloud
Copy link
Member

cpcloud commented May 21, 2014

I think this is my fault. I added the op() calls for the rops. This particular issue was untested.

@jreback
Copy link
Contributor Author

jreback commented May 21, 2014

fessing up! :)

np....this tests this explicity

took me a bit to figure out that sub/div are not commutative while add/mul ARE!

@cpcloud
Copy link
Member

cpcloud commented May 21, 2014

Might be better to just remove the rops op($ calls than to add the reversed check

@cpcloud
Copy link
Member

cpcloud commented May 21, 2014

Unless that isn't the issue. But I think that's the only thing other than the raise on bool ops that has changed between 0.13.1 and 14

@jreback
Copy link
Contributor Author

jreback commented May 21, 2014

python somehow seems to handle them correctly (e.g. it in-line reverses)

__rtruediv__(x,y)
__truediv__(x,y)

do the right thing!

whereas in numexpr the 2nd is backwards

I don't have any idea WHEN python decides to call the reversed ops, but no biggie, just added a flag and it should work

@cpcloud
Copy link
Member

cpcloud commented May 21, 2014

It's done at the c level in pyobject_richcompare I followed it once for some Timestamp compare stuff. Good times

@jreback
Copy link
Contributor Author

jreback commented May 21, 2014

haha....ok...no worries

jreback added a commit that referenced this pull request May 21, 2014
BUG: Bug in expressions evaluation with reversed ops, showing in series-dataframe ops (GH7198)
@jreback jreback merged commit 2e1b092 into pandas-dev:master May 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
2 participants