You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
same error as in #60455 (which was already solved for DataFrames by #60459) but here output is a Series
Expected Behavior
selected column is printed abbreviated form, no KeyError
Traceback (most recent call last):
File "", line 1, in
File "/py/envs/pandas-dev/lib/python3.10/site-packages/pandas/core/series.py", line 1437, in __repr__
return self.to_string(**repr_params)
File "/py/envs/pandas-dev/lib/python3.10/site-packages/pandas/util/_decorators.py", line 332, in wrapper
return func(*args, **kwargs)
File "/py/envs/pandas-dev/lib/python3.10/site-packages/pandas/core/series.py", line 1534, in to_string
formatter = fmt.SeriesFormatter(
File "/py/envs/pandas-dev/lib/python3.10/site-packages/pandas/io/formats/format.py", line 226, in __init__
self._chk_truncate()
File "/py/envs/pandas-dev/lib/python3.10/site-packages/pandas/io/formats/format.py", line 248, in _chk_truncate
series = concat((series.iloc[:row_num], series.iloc[-row_num:]))
File "/py/envs/pandas-dev/lib/python3.10/site-packages/pandas/core/reshape/concat.py", line 440, in concat
return _get_result(
File "/py/envs/pandas-dev/lib/python3.10/site-packages/pandas/core/reshape/concat.py", line 547, in _get_result
return result.__finalize__(
File "/py/envs/pandas-dev/lib/python3.10/site-packages/pandas/core/generic.py", line 6070, in __finalize__
have_same_attrs = all(obj.attrs == attrs for obj in objs[1:])
File "/py/envs/pandas-dev/lib/python3.10/site-packages/pandas/core/generic.py", line 6070, in
have_same_attrs = all(obj.attrs == attrs for obj in objs[1:])
File "/py/envs/pandas-dev/lib/python3.10/site-packages/pandas/core/generic.py", line 1496, in __bool__
raise ValueError(
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Installed Versions
INSTALLED VERSIONS
------------------
commit : 9501650
python : 3.10.16
python-bits : 64
OS : Linux
OS-release : 6.11.10-2-MANJARO
Version : #1 SMP PREEMPT_DYNAMIC Mon, 25 Nov 2024 05:29:44 +0000
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : de_DE.UTF-8
LOCALE : de_DE.UTF-8
kaba439
changed the title
BUG: ValueError when printing a DataFrame's column having a DatFrame in its attrs
BUG: ValueError when printing a DataFrame's column having a DataFrame in its attrs
Dec 14, 2024
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
Issue Description
same error as in #60455 (which was already solved for DataFrames by #60459) but here output is a Series
Expected Behavior
selected column is printed abbreviated form, no KeyError
Installed Versions
pandas : 0+untagged.1.g9501650
numpy : 1.26.4
dateutil : 2.9.0.post0
pip : 24.3.1
Cython : 3.0.11
sphinx : 8.1.3
IPython : 8.30.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
blosc : None
bottleneck : 1.4.2
fastparquet : 2024.11.0
fsspec : 2024.10.0
html5lib : 1.1
hypothesis : 6.122.3
gcsfs : 2024.10.0
jinja2 : 3.1.4
lxml.etree : 5.3.0
matplotlib : 3.9.4
numba : 0.60.0
numexpr : 2.10.2
odfpy : None
openpyxl : 3.1.5
psycopg2 : 2.9.9
pymysql : 1.4.6
pyarrow : 18.1.0
pyreadstat : 1.2.8
pytest : 8.3.4
python-calamine : None
pytz : 2024.2
pyxlsb : 1.0.10
s3fs : 2024.10.0
scipy : 1.14.1
sqlalchemy : 2.0.36
tables : 3.10.1
tabulate : 0.9.0
xarray : 2024.9.0
xlrd : 2.0.1
xlsxwriter : 3.2.0
zstandard : 0.23.0
tzdata : 2024.2
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: