BUG: DataFrame
constructor not compatible with array-like classes that have a 'name'
attribute
#61443
Open
2 of 3 tasks
Labels
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
Originally posted in pyvista/pyvista#7519
Issue Description
Wrapping a
DataFrame
with the array-like object above results in an unexpectedValueError
being raised. The cause is this line, which assumes that the input object must be aSeries
orIndex
type based on having a'name'
attribute.pandas/pandas/core/frame.py
Lines 798 to 799 in 41968a5
This assumption fails for the
VTKArray
poly.points
, which also has a'name'
attribute.Expected Behavior
No error should be raised, and the array-like input should be wrapped correctly by
DataFrame
Installed Versions
INSTALLED VERSIONS
commit : 0691c5c
python : 3.12.2
python-bits : 64
OS : Darwin
OS-release : 23.4.0
Version : Darwin Kernel Version 23.4.0: Fri Mar 15 00:19:22 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8112
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : None
LOCALE : en_CA.UTF-8
pandas : 2.2.3
numpy : 1.26.4
pytz : 2025.2
dateutil : 2.9.0.post0
pip : 25.1.1
Cython : None
sphinx : 8.1.3
IPython : 8.36.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.13.4
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : 6.131.9
gcsfs : None
jinja2 : 3.1.6
lxml.etree : None
matplotlib : 3.10.1
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : None
pyreadstat : None
pytest : 8.3.5
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.14.1
sqlalchemy : None
tables : None
tabulate : 0.9.0
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2025.2
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: