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
My interpretation is that this happens because pandas treats the nested DataFrame as a normal sequence and tries to iterate on it, but for DataFrames len(df) != len(list(df)) because the former is #rows and the latter is #columns.
This issue is essentially the same as #49195, but that issue was incorrectly triaged as been an issue with an external library.
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
The above code crashed with the stack trace:
Stack trace
My interpretation is that this happens because pandas treats the nested DataFrame as a normal sequence and tries to iterate on it, but for DataFrames
len(df) != len(list(df))
because the former is #rows and the latter is #columns.This issue is essentially the same as #49195, but that issue was incorrectly triaged as been an issue with an external library.
Expected Behavior
Any reasonable repr output. Should not crash.
Installed Versions
The text was updated successfully, but these errors were encountered: