original) (raw)
DataFrame.append with empty list raises IndexError · Issue #28769 · pandas-dev/pandas (Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
Code Sample
import pandas pandas.DataFrame().append([]) Traceback (most recent call last): File "", line 1, in File ".env\lib\site-packages\pandas\core\frame.py", line 7108, in append elif isinstance(other, list) and not isinstance(other[0], DataFrame): IndexError: list index out of range pandas.version '0.25.1'
Problem description
Crash when passing empty sequence to DataFrame.append
Expected Output
No crash.
The source DataFrame is returned intact.
Version
Version 0.25.1. Happens in master.
Problem line
https://github.com/pandas-dev/pandas/blob/master/pandas/core/frame.py#L7014