-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: read_fwf doesn't allow names with colspec='infer' #45337
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
Could you share a sample input of the data or a |
What's needed beyond what I put under
in the original report? |
Ideally it helps if the example is copy-pastable such that it helps with investigating the potential bug: https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports Additionally, |
I've edited the original code to include the sample data in a |
Great, thank you. I can fully replicate the issue now. |
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 master branch of pandas.
Reproducible Example
Issue Description
On pandas 1.4.0rc0, that code produces:
It seems the problem is that it's checking names while colspecs is still set to
'infer'
:pandas/pandas/io/parsers/readers.py
Line 842 in d023ba7
I don't see a quick fix since the handling of
"infer"
appears to be buried somewhere else.Expected Behavior
This code ran fine in Pandas <1.4rc0. Looks like the check was added in #40830.
Installed Versions
INSTALLED VERSIONS
commit : d023ba7
python : 3.10.1.final.0
python-bits : 64
OS : Darwin
OS-release : 21.2.0
Version : Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.4.0rc0
numpy : 1.22.0
pytz : 2021.3
dateutil : 2.8.2
pip : 21.3.1
setuptools : 59.7.0
Cython : None
pytest : 6.2.5
hypothesis : None
sphinx : 4.3.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.3
IPython : 7.31.0
pandas_datareader: None
bs4 : 4.10.0
bottleneck : None
fsspec : 2021.11.1
fastparquet : None
gcsfs : None
matplotlib : 3.5.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : 2021.11.1
scipy : 1.7.3
sqlalchemy : None
tables : None
tabulate : None
xarray : 0.20.2
xlrd : None
xlwt : None
numba : None
zstandard : None
The text was updated successfully, but these errors were encountered: