I got a problem dealing with dataframe. I want to insert rows in DF and modify its related values:
for example I have
time value 0 10:00 2 1 11:00 4 2 12:00 6 3 13:00 8
and the ideal result should be:
time value 0 10:00 1 1 11:00 2 0 10:00 1 1 11:00 2 2 12:00 6 3 13:00 8
Which duplicate first two rows and then divide its value evenly.
The code can only append rows but how to modify its values in a faster way?
df[0:2].append(df[0:2]).append(df[2:])