BUG: 1.2. version fails in adding column if number on column name beginning. #39010
Closed
3 tasks done
Labels
Bug
Indexing
Related to indexing on series/frames, not to indexes themselves
Regression
Functionality that used to work in a prior pandas version
Milestone
Code that raise traceback
Result:
ValueError: format number 1 of "0 - Name" is not recognized
If other name witho no mumber on column name, it will pass.
In older version, worked correctly
Tested on new virtualenv - just
pip install pandas
Failed also on Travis (Python 3.6 passed, 3.7 and 3.8 failed), so probably not my IDE setup or something similar
Full traceback here...
Problem description
Very strange is than it happens only if it's first assignment, so this will work correctly with no error
Expected Output
I do not create dataframe with numeric names, but thing is, that if source data are numpy, than created dataframe has numeric range index. If user in my library insert data - i create some derivations - want to keep names + name of derivation - thus if somebody insert numpy, it will fail.
Expected output is creating new column with number in column name start - or generating columns like ['1', '2', '3'] from arrays which works...
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : 3e89b4c
python : 3.7.7.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.17763
machine : AMD64
processor : Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
byteorder : little
LC_ALL : None
LANG : cs_CZ.UTF-8
LOCALE : None.None
pandas : 1.2.0
numpy : 1.19.5
pytz : 2020.5
dateutil : 2.8.1
pip : 20.1
setuptools : 46.1.3
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: