original_docstring: 
      Compute the distance traveled and speed of sets of trajectories
  
      Parameters
      ----------
      num_trajectories
          number of trajectories (unique object ids)
      object_ids
          column of object (e.g., vehicle) ids
      xs
          column of x-coordinates (in kilometers)
      ys
          column of y-coordinates (in kilometers)
      timestamps
          column of timestamps in any resolution
  
      Returns
      -------
      result : cudf.DataFrame
          meters : cudf.Series
              trajectory distance (in kilometers)
          speed  : cudf.Series
              trajectory speed (in meters/second)
  
      Examples
      --------
      Compute the distances and speeds of derived trajectories
  
      >>> objects, traj_offsets = cuspatial.derive_trajectories(...)
      >>> dists_and_speeds = cuspatial.trajectory_distances_and_speeds(
              len(traj_offsets)
              objects['object_id'],
              objects['x'],
              objects['y'],
              objects['timestamp']
          )
      >>> print(dists_and_speeds)
                         distance          speed
          trajectory_id
          0                1000.0  100000.000000
          1                1000.0  111111.109375
      
docstring: Compute the distance traveled and speed of sets of trajectories
  Parameters
  
  num_trajectories
  number of trajectories (unique object ids)
  object_ids
  column of object  ids
  xs
  column of x-coordinates (in kilometers)
  ys
  column of y-coordinates (in kilometers)
  timestamps
  column of timestamps in any resolution
  
  Returns
  
  result : cudf.DataFrame
  meters : cudf.Series
  trajectory distance (in kilometers)
  speed  : cudf.Series
  trajectory speed (in meters/second)
  
  Examples
  
  Compute the distances and speeds of derived trajectories
  
  
docstring_tokens: Compute the distance traveled and speed of sets of trajectories Parameters num_trajectories number of trajectories ( unique object ids ) object_ids column of object ids xs column of x - coordinates ( in kilometers ) ys column of y - coordinates ( in kilometers ) timestamps column of timestamps in any resolution Returns result : cudf . DataFrame meters : cudf . Series trajectory distance ( in kilometers ) speed : cudf . Series trajectory speed ( in meters / second ) Examples Compute the distances and speeds of derived trajectories
code: def trajectory_distances_and_speeds(
      num_trajectories, object_ids, xs, ys, timestamps
  ):
      """
      Compute the distance traveled and speed of sets of trajectories
  
      Parameters
      ----------
      num_trajectories
          number of trajectories (unique object ids)
      object_ids
          column of object (e.g., vehicle) ids
      xs
          column of x-coordinates (in kilometers)
      ys
          column of y-coordinates (in kilometers)
      timestamps
          column of timestamps in any resolution
  
      Returns
      -------
      result : cudf.DataFrame
          meters : cudf.Series
              trajectory distance (in kilometers)
          speed  : cudf.Series
              trajectory speed (in meters/second)
  
      Examples
      --------
      Compute the distances and speeds of derived trajectories
  
      >>> objects, traj_offsets = cuspatial.derive_trajectories(...)
      >>> dists_and_speeds = cuspatial.trajectory_distances_and_speeds(
              len(traj_offsets)
              objects['object_id'],
              objects['x'],
              objects['y'],
              objects['timestamp']
          )
      >>> print(dists_and_speeds)
                         distance          speed
          trajectory_id
          0                1000.0  100000.000000
          1                1000.0  111111.109375
      """
  
      object_ids = as_column(object_ids, dtype=np.int32)
      xs, ys = normalize_point_columns(as_column(xs), as_column(ys))
      timestamps = normalize_timestamp_column(as_column(timestamps))
      df = DataFrame._from_data(
          *cpp_trajectory_distances_and_speeds(
              num_trajectories, object_ids, xs, ys, timestamps
          )
      )
      df.index.name = "trajectory_id"
      return df
code_tokens: def trajectory_distances_and_speeds ( num_trajectories , object_ids , xs , ys , timestamps ) : object_ids = as_column ( object_ids , dtype = np . int32 ) xs , ys = normalize_point_columns ( as_column ( xs ) , as_column ( ys ) ) timestamps = normalize_timestamp_column ( as_column ( timestamps ) ) df = DataFrame . _from_data ( * cpp_trajectory_distances_and_speeds ( num_trajectories , object_ids , xs , ys , timestamps ) ) df . index . name = "trajectory_id" return df
short_docstring: Compute the distance traveled and speed of sets of trajectories
  Parameters
short_docstring_tokens: Compute the distance traveled and speed of sets of trajectories Parameters
comment: """
      Compute the distance traveled and speed of sets of trajectories
  
      Parameters
      ----------
      num_trajectories
          number of trajectories (unique object ids)
      object_ids
          column of object (e.g., vehicle) ids
      xs
          column of x-coordinates (in kilometers)
      ys
          column of y-coordinates (in kilometers)
      timestamps
          column of timestamps in any resolution
  
      Returns
      -------
      result : cudf.DataFrame
          meters : cudf.Series
              trajectory distance (in kilometers)
          speed  : cudf.Series
              trajectory speed (in meters/second)
  
      Examples
      --------
      Compute the distances and speeds of derived trajectories
  
      >>> objects, traj_offsets = cuspatial.derive_trajectories(...)
      >>> dists_and_speeds = cuspatial.trajectory_distances_and_speeds(
              len(traj_offsets)
              objects['object_id'],
              objects['x'],
              objects['y'],
              objects['timestamp']
          )
      >>> print(dists_and_speeds)
                         distance          speed
          trajectory_id
          0                1000.0  100000.000000
          1                1000.0  111111.109375
      """