I would like to calculate a new variable "acceleration (in m/s^2)" for longitudinal recorded car data and only have the speed of the car(in m/s) and the recording time (in s).
This is a part of the dataframe df:
speed time_sec
1 27.520 0.273
2 27.520 0.313
3 27.172 0.353
4 26.887 0.393
5 26.560 0.433
6 26.560 0.473
How could I add a new variable "acceleration (positive values)/ deceleration (negative values)" to every recording row of the car?