-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Checking that a pandas.Series.index contains a value #22085
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
Thanks for the report! A simpler example:
it seems to be specific for the Int64Engine (float or object correctly give false) |
The problem seems to be here: Lines 93 to 96 in 26b3e7d
for Int64Engine mapping is Int64HashTable >>> from pandas._libs.hashtable import Int64HashTable
>>> ht = Int64HashTable(3)
>>> ht.map_locations(np.array([1, 2, 3]))
>>> 1.1 in ht
True |
This is because of cython casting the input float to int. Small example showing that behaviour:
Not sure if you can let cython not do such a cast on demand? (cc @jreback) |
these get casted to int by cython |
Can I take this issue? I want to start contributing to this repository. |
Yes, go ahead. If you have any questions related to the fix, don't hesitate to ask here. |
@jorisvandenbossche thanks a lot. |
Code Sample, a copy-pastable example if possible
Problem description
I reported it here. The output of the last line is True instead of being False.
Expected Output
False
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]INSTALLED VERSIONS
commit: None
python: 3.6.2.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.23.3
pytest: 3.2.1
pip: 9.0.1
setuptools: 40.0.0
Cython: 0.26.1
numpy: 1.15.0
scipy: 0.19.1
pyarrow: None
xarray: None
IPython: 6.1.0
sphinx: 1.6.3
patsy: 0.4.1
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: 1.2.1
tables: 3.4.2
numexpr: 2.6.2
feather: None
matplotlib: 2.2.2
openpyxl: 2.4.8
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 0.9.8
lxml: 3.8.0
bs4: 4.6.0
html5lib: 0.999999999
sqlalchemy: 1.1.13
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: