Skip to content

BUG: unwanted casting in .isin #21804

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

Closed
jreback opened this issue Jul 7, 2018 · 5 comments · Fixed by #37770
Closed

BUG: unwanted casting in .isin #21804

jreback opened this issue Jul 7, 2018 · 5 comments · Fixed by #37770
Assignees
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions isin isin method
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Jul 7, 2018

xref #19508 for a partial PR

In [3]: values = [1, 0.5]
   ...: pd.Series([1, 0]).isin(values)
   ...: 
Out[3]: 
0    True
1    True
dtype: bool

should be [True, False]

@jreback jreback added Bug Dtype Conversions Unexpected or buggy dtype conversions Difficulty Intermediate labels Jul 7, 2018
@jreback jreback added this to the Contributions Welcome milestone Jul 7, 2018
@gorbondiga
Copy link

hey jreback, I would like to take this bug if possible.

@KalyanGokhale
Copy link
Contributor

@jdoepfert Thanks for the groundwork on initial PR
@gorbondiga just saw your comment. I was working on this for last 2 days and have fixed it - sorry for not commenting here earlier. If you haven't already started working on it, please let me know whether its OK for me to submit PR? In case I don't hear back by Friday, then I'll submit a PR assuming its fine for me to do so.
@jreback all tests do pass, though pandas/tests/io/test_clipboard.py module fails as part of suite - however passes when ran individually (seems unrelated to this bug fix). Have also ran the asvs for algorithms and results are as follows:

       before           after         ratio
     [5380fcd4]       [bf0543f1]
+     1.80±0.01ms      2.26±0.02ms     1.25  algorithms.Hashing.time_series_int
-     2.21±0.02ms      1.81±0.01ms     0.82  algorithms.Hashing.time_series_dates
-        2.21±0ms      1.80±0.02ms     0.81  algorithms.Hashing.time_series_float
-        15.9±3ms      11.8±0.09ms     0.74  algorithms.Factorize.time_factorize_float(False)

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.

@gorbondiga
Copy link

It's fine @KalyanGokhale, I am looking for some bug to start contributing to pandas, I though it culd be a good one, this one, but if you already solved it go for it

@avinashpancham
Copy link
Contributor

take

@avinashpancham
Copy link
Contributor

Will be closed by #37770

@jreback jreback modified the milestones: Contributions Welcome, 1.3 Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment