Pandas: BUG: unwanted casting in .isin

Created on 8 Jul 2018  路  5Comments  路  Source: pandas-dev/pandas

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]

Bug Dtypes isin

All 5 comments

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

@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.

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

take

Will be closed by #37770

Was this page helpful?
0 / 5 - 0 ratings