pandas.DataFrame.xyz.v_from_s
- DataFrame.xyz.v_from_s(**kwargs)[source]
Calculate speed from cumulative distances.
The chosen scheme: speed at [i] represents the distance from [i] to [i+1]. This means distance.diff() and time.diff() are shifted by one index from speed. I have chosen to extrapolate the speed at the final position by ffill.
- Parameters
**distance (scalar) – column label in the record DataFrame containing cumulative distances along the route in meters. Must be numeric dtype. If a label is not provided, the parameter name itself is used.
**time (scalar) – column label in the record DataFrame containing cumulative time from start along the route in seconds. Must be numeric dtype. If a label is not provided, the parameter name itself is used. Default None.
- Returns
speed along the route in meters per second.
- Return type
pandas.Series