movingpandas.TrajectoryCollection.add_timedelta#

TrajectoryCollection.add_timedelta(overwrite=False, name='timedelta', n_processes=1, **kwargs)#

Add timedelta column and values to the trajectories.

Timedelta is calculated as the time difference between the current and the previous row. Values are instances of datetime.timedelta.

Parameters:
  • overwrite (bool) – Whether to overwrite existing timedelta values (default: False)

  • name (str) – Name of the timedelta column (default: “timedelta”)

  • n_processes (int or None, optional) – Number of processes to use for computation (default: 1). If set to None, the number of processes will be set to os.cpu_count(), enabling full CPU utilization via multiprocessing.

  • n_threads (int, optional) – DEPRECATED. Use n_processes instead. This parameter will be removed in a future version.