-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: index_col in read_csv ignores dtype argument #59077
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
take |
Seems to be a behavior change for the default c engine only. |
thanks for the report - we should probably first do a git bisect to see which commit introduced the bug running it now: https://www.kaggle.com/code/marcogorelli/pandas-regression-example?scriptVersionId=187955574 |
@MarcoGorelli Hi Marco, I tried rerunning the regression example with just |
It looks like the right commit, specifically this change to pandas/core/indexes/base.py ded256d#diff-c34a28314fc8cb12f0d2aa710f1c15f06cdfe3e48f03e658f01f99a43d4f5d09
|
cool, thanks for checking (cc @mroeschke just fyi, no blame 🤗 ) |
Pandas version checks
Reproducible Example
Issue Description
df.index.dtype
isint64
with pandas3.0.0.dev0+1132.ga5e812d86d
, although thedtype
parameter already sets it tonp.uint32
. The issue is similar to an old issue #9435.Expected Behavior
Pandas 2.x correctly returns
uint32
, which is the expected behavior.Installed Versions
pandas : 3.0.0.dev0+1132.ga5e812d86d
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : 70.0.0
pip : 24.0
Cython : None
pytest : 8.2.1
hypothesis : None
sphinx : 7.3.7
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.25.0.dev
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
fastparquet : None
fsspec : 2024.5.0
gcsfs : None
matplotlib : 3.10.0.dev202+gd901275d7c
numba : None
numexpr : None
odfpy : None
openpyxl : None
pyarrow : 16.1.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : 0.9.0
xarray : 2024.5.1.dev6+g12123be8
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: