Answers for "pandas add row to time series dataframe"

1

pandas insert row

df.loc[-1] = [2, 3, 4]  # adding a row
 df.index = df.index + 1  # shifting index
 df = df.sort_index()  # sorting by index
Posted by: Guest on June-26-2020

Code answers related to "pandas add row to time series dataframe"

Python Answers by Framework

Browse Popular Code Answers by Language