Non-unique integers coerced to float during UInt64Index creation with explicit #29526
Labels
Bug
Dtype Conversions
Unexpected or buggy dtype conversions
Index
Related to the Index class or subclasses
Milestone
Noticed this thanks to @jschendel 's comment over here. I'll use this to learn more about data types and try to suggest a reasonable solution.
Somewhat relevant: #15832, #18400
Code Sample, a copy-pastable example if possible
Problem description
The numpy array creation here coerces to float, while it's possible to specify dtype and prevent this behavior.
Expected Output
UInt64Index contains precisely the input values.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.3.final.0
python-bits : 64
OS : Windows
OS-release : 10
machine : AMD64
processor : Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : None.None
pandas : 0.25.3
numpy : 1.16.4
pytz : 2019.1
dateutil : 2.8.0
pip : 19.1.1
setuptools : 41.0.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.3.4
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.10.1
IPython : 7.5.0
pandas_datareader: None
bs4 : 4.7.1
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : 4.3.4
matplotlib : 3.1.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : 1.3.0
sqlalchemy : None
tables : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
Replicates on current master as well.
The text was updated successfully, but these errors were encountered: