pandas.DataFrame.pos.v_from_ds

DataFrame.pos.v_from_ds(**kwargs)[source]

Calculate speed from point-to-point displacements.

The chosen scheme: displacement at [i] represents the distance from [i-1] to [i], while speed at [i] represents the distance from [i] to [i+1]. This means displacements and time.diff() are shifted by one index from speed. I have chosen to extrapolate the speed at the final position by ffill.

Parameters
  • **displacement (scalar) – column label in the record DataFrame containing point-to-point displacements 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. Default None.

Returns

speed along the route in meters per second.

Return type

pandas.Series