Skip to content
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: isin - dtype conversions (Timestamp vs ints) #36621

Closed
3 tasks done
asishm opened this issue Sep 25, 2020 · 0 comments · Fixed by #37528
Closed
3 tasks done

BUG: isin - dtype conversions (Timestamp vs ints) #36621

asishm opened this issue Sep 25, 2020 · 0 comments · Fixed by #37528
Labels
Bug isin isin method
Milestone

Comments

@asishm
Copy link
Contributor

asishm commented Sep 25, 2020

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


related: #34125 : could be closed in favor of that if it is too much of a duplicate.

Code Sample, a copy-pastable example

import pandas as pd
s = pd.Series(pd.date_range("jan-01-2013", "jan-05-2013"))
s.isin([1356998400000000000])
>>>
0     True
1    False
2    False
3    False
4    False
dtype: bool

Problem description

Problem arises here because algos._ensure_dtype(s) returns an np.int64 array (that matches the data) and dtype=<M8[ns].

Expected Output

0    False
1    False
2    False
3    False
4    False
dtype: bool
@asishm asishm added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 25, 2020
@asishm asishm changed the title BUG: isin - dtype conversions BUG: isin - dtype conversions (Timestamp vs ints) Sep 25, 2020
@jbrockmendel jbrockmendel added the isin isin method label Oct 30, 2020
@jreback jreback added this to the 1.2 milestone Nov 22, 2020
@simonjayhawkins simonjayhawkins removed the Needs Triage Issue that has not been reviewed by a pandas team member label Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug isin isin method
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants