I have a column with acceleration values, and I’m trying to integrate them in a new column. Here’s what I want as output :
A B
0 a b-a
1 b c-b
2 c d-c
3 d …-d
…
I’m currently doing like that
l=[]
for i in range(len(df)):
l.append(df.values[i+1][0]-df.values[i][0])
df[1]=l
That’s very slow to process. I have over a million lines, and this in 20 different csv files. Is there a way to do it faster ?