-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
BUG: take nans correctly into consideration in complex and tuple #41952
Conversation
For the upcoming issues with Py3.10 and hash-functions (see this comment #41836 (comment) and #41953) there will be a separate PR soonish. |
It looks as if this exampe fails:
To me it seems, that the new behavior is correct. At least it would be result if |
does this change outward behavior for <= 3.9? asking if we should put this in 1.3 (inclination is yes) |
@jreback The only behavioral change I'm aware of is fixing the bug #41836 (which also lead to this change in the test suitehttps://github.com//pull/41952/commits/0b02e27eb14f7f059740081eb71639550832d05f). The performance didn't really suffer much under this change, there is a typical run (somehow on my machine the variance is quite high between different runs):
|
ok labeling this for 1.3 |
@jreback Do you think a what's new entry is needed? |
yeah why don't you add one just in case. merge master and ping on green. |
…ll be traversed twice)
…rectly into account
@jreback it is green(ish) - the failures seem to be unrelated to this PR. |
agreed. restarted ci to be sure |
doc/source/whatsnew/v1.3.0.rst
Outdated
@@ -1033,6 +1033,7 @@ Missing | |||
- Bug in :meth:`DataFrame.fillna` not accepting a dictionary for the ``downcast`` keyword (:issue:`40809`) | |||
- Bug in :func:`isna` not returning a copy of the mask for nullable types, causing any subsequent mask modification to change the original array (:issue:`40935`) | |||
- Bug in :class:`DataFrame` construction with float data containing ``NaN`` and an integer ``dtype`` casting instead of retaining the ``NaN`` (:issue:`26919`) | |||
- Bug in :func:`isin` didn't treat all nans as equivalent if they were in tuples (:issue:`41836`) |
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.
this ref is an internal one. does this for example affect Series.isin in a user visible way?
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.
yes, the motivating case was MultiIndex.isin
@@ -163,18 +163,81 @@ KHASH_MAP_INIT_COMPLEX128(complex128, size_t) | |||
#define kh_exist_complex128(h, k) (kh_exist(h, k)) | |||
|
|||
|
|||
int PANDAS_INLINE floatobject_cmp(PyFloatObject* a, PyFloatObject* b){ |
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.
can you add some comments before these of what is going on / why doing is & the issue reference
lgtm @realead just a few doc comments, ping when green |
@jreback green. |
thanks @realead |
…tion in complex and tuple
@meeseeksdev backport 1.3.x |
Something went wrong ... Please have a look at my logs. |
…mplex and tuple (#42058) Co-authored-by: realead <egor.dranischnikow@googlemail.com>
NaNs as Float are already handled correctly (all nans are the same equavalency class), this PR adds similar functionality for complex and tuple.
It doesn't handle
frozenset
(see also discussion in #41836) because it would require to duplicate a lot of code/internal details from setobject.