I have a dataframe like this
Temp time[s]
0 20 0
1 21 1
2 21.5 2
I want to repeat the dataframe but add the timestamp, my output should like this ,
Temp time[s]
0 20 0
1 21 1
2 21.5 2
3 20 3
4 21 4
5 21.5 5
I tried something like this , but didn't worked for me
df2 = pd.concat([df]*2, ignore_index=True)
df2['time[s]'] = df2.groupby(level=0).cumcount() * 1
Can anyone help me plz ?