-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: pd.read_csv does not work with nullable_dtype coercion #52594
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
Hi, thanks for your report. I think we have an open issue about this (this looks familiar to me). Could you double check the issue tracker? |
Hey Searching for "pd.read_csv" I went back to October 2022 without finding any mention to bugs related to dtype coercion. What seems similar : What I can find that could be related : If 52086 is the same, we can close either this one or the other (then sorry for the double bug, but I didn't open every single bug to read the content 😄 ) |
The bug is still present in 2.0.3. |
Bug is still present in 2.2.2 INSTALLED VERSIONScommit : d9cdd2e pandas : 2.2.2 |
I did further investigations on this issue on main (commit 16b7288). If you explicitly specify Regarding the test suit, there is a single test 'function' to test the c engine with 'delimiter' parameter and it can be run in a development environment with > pytest pandas/tests/io/parser/test_c_parser_only.py::test_1000_sep_with_decimal Within this test, by adding the argument If relevant I can create and PR a test (marking it as failing) for this issue. Anyway, one workaround is to use any engine besides |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Error thrown :
But it can read :
Issue Description
I think it's related to #49146, the dtype coercion does not work with nullable dtypes.
Expected Behavior
It should be able to read them with the requested dtype
Installed Versions
INSTALLED VERSIONS
commit : 478d340
python : 3.10.10.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19042
machine : AMD64
processor : AMD64 Family 23 Model 24 Stepping 1, AuthenticAMD
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_Netherlands.1252
pandas : 2.0.0
numpy : 1.23.5
pytz : 2023.3
dateutil : 2.8.2
setuptools : 67.6.1
pip : 23.0.1
Cython : None
pytest : 7.2.2
hypothesis : None
sphinx : 6.1.3
blosc : None
feather : None
xlsxwriter : 3.0.9
lxml.etree : 4.9.2
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.12.0
pandas_datareader: 0.10.0
bs4 : 4.12.1
bottleneck : None
brotli :
fastparquet : None
fsspec : 2023.3.0
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.1.0
pandas_gbq : None
pyarrow : 11.0.0
pyreadstat : None
pyxlsb : 1.0.10
s3fs : None
scipy : 1.10.1
snappy : None
sqlalchemy : None
tables : None
tabulate : 0.9.0
xarray : None
xlrd : 2.0.1
zstandard : 0.19.0
tzdata : 2023.3
qtpy : 2.3.1
pyqt5 : None
The text was updated successfully, but these errors were encountered: