IO Conflict Between index_col and dtype #25067
Labels
Duplicate Report
Duplicate issue or pull request
IO Data
IO issues that don't fit into a more specific label
Uh oh!
There was an error while loading. Please reload this page.
Code Sample, a copy-pastable example if possible
I'm reading in an excel file using the code below. Assume that column 0 is my zip codes and column 2 is my adjustment factor that I'm mapping zips to.
Problem description
In my situation, I need zipcodes to be dtype of object since zipcodes can start with 0's, but the converter under-the-hood is converting these to int's and dropping the 0's.
This requires an extra step as a workaround:
But couldn't this be done within pd.read_excel by checking whether the index column parameter has a specified dtype parameter?
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.4.final.0
python-bits: 32
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.23.4
pytest: 3.7.1
pip: 18.1
setuptools: 40.5.0
Cython: None
numpy: 1.15.2
scipy: 1.2.0
pyarrow: None
xarray: None
IPython: 6.2.1
sphinx: None
patsy: None
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: 2.5.5
xlrd: 1.1.0
xlwt: None
xlsxwriter: 1.1.2
lxml: 4.1.1
bs4: 4.6.1
html5lib: 1.0.1
sqlalchemy: 1.2.12
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: