Append an empty row in dataframe using pandas

The Solution to Append an empty row in dataframe using pandas is


Add a new pandas.Series using pandas.DataFrame.append().

If you wish to specify the name (AKA the "index") of the new row, use:

df.append(pandas.Series(name='NameOfNewRow'))

If you don't wish to name the new row, use:

df.append(pandas.Series(), ignore_index=True)

where df is your pandas.DataFrame.

~ Answered on 2019-01-23 14:53:16


Most Viewed Questions: