0

I have the following panda dataframe:(df)

enter image description here

How can I append only the last row (Date 2021-01-22) to a new dataframe (df_new)?

Yvar
  • 155
  • 4
  • 14

1 Answers1

1
df_new = df_new.append(df.tail(1)) 

if df_new is not defined. The following code will do it.

df_new = df.tail(1)
r.burak
  • 514
  • 5
  • 10