pandas.DataFrame.xyz.s_from_v

DataFrame.xyz.s_from_v(**kwargs)[source]

Calculate cumulative distances from speed

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 position at the first index by assuming we start at a cumulative distance of 0.

Parameters
  • **speed (scalar) – column label in the record DataFrame containing speed along the route in meters per second. 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

cumulative distances along the route in meters.

Return type

pandas.Series