-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
boolean vs. scalar comparisons very recently broke in master #7284
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
Comments
@cpcloud would know more about what actually is tested here. But the point is that somehow |
Looks like it is related to #7254 which was just merged. We tried changing it so Maybe we will have to revert that, but maybe we can investigate a little first.. |
Thanks for the report also, it's nice to know pandas catches bugs so quickly! |
hah we r using wheels from your master - so thank you! |
So pandas is literally expecting that Even though it's a rare case we should still try to make randint 100% backward compatible. I think we can do so while keeping #7254's nice behavior that @gfyoung, what do you think of this: We could make the default value of |
This is indeed a pity, but backwards compatibility must be respected. Here is what I suggest: I think it is still correct to return |
I'm not sure it's worth forcing people to adjust to a change, since there is so little benefit (python integers can represent any numpy integers). If we make the signature be
by
then if the user requests a python type, they get a python type, and if they request a numpy type ,they get a numpy type, and we get to keep the old default. (remove |
@ahaldane : Fair enough. |
ok, this looks good in pandas master. Have some new breakages though: pandas-dev/pandas#12406 |
@jreback it is due to gh-7215. Does this bother you/create incompatibilities with older pandas versions or is it just a note seen in tests? Numpy used to patch the error to be an index error in this case, but Nathaniel removed it to simplify code, it would be nice to not having to replace the error, but if it creates compat problems we have to think about it. Can't say I really expected problems there ;). |
@seberg no the |
Ah, ok, I did not realize it was two things when glancing over. Chuck is still busy with some floordiv stuff, he might have a quick idea what is going on. |
@jreback Could you specify what the arguments were? |
I'll have to see if I can give u a self contained example in a bit |
@jreback I think it is 3. // 0.. Note two things,
Currently numpy computes the |
Another case that probably differs and is specified by Python is
|
Wow, those are brain breaking examples. But I think The |
@njsmith I think it probably is specified, as MSVC 2008 got it wrong and it is corrected in later versions. |
Annex F:
|
Which makes me think I should explicitly return nan rather than the result of fmod in the case of zero division so that things work properly on MSVC 2008 also. |
So here's a simple repro.
|
so my test fails because we are expecting the This is 1.10.4
|
@jreback Yes, but what should we do about it. Nan is probably the most correct. |
@charris yes agree |
@jreback OK, I will make sure the release notes mention it. |
Actually, MSVC 2008 gets the |
The 'pandas' library expects Python integers to be returned, so this commit changes the API so that the default is 'np.int' which converts to native Python integer types when a singleton is being generated with this function. Closes numpygh-7284.
between these 2 commits:
1.12.0.dev0+f4cc58c (good)
1.12.0.dev0+a2f5392 (bad)
pandas now started failing here:
https://travis-ci.org/pydata/pandas/jobs/110022540 (bad)
xref: pandas-dev/pandas#12390
The text was updated successfully, but these errors were encountered: