original_docstring: 
          Add direction column and values to the trajectory's dataframe.
  
          The direction is calculated between the trajectory's start and end location.
          Direction values are in degrees, starting North turning clockwise.
  
          Parameters
          ----------
          overwrite : bool
              Whether to overwrite existing direction values (default: False)
          
docstring: Add direction column and values to the trajectory's dataframe.
  The direction is calculated between the trajectory's start and end location.
  Direction values are in degrees, starting North turning clockwise.
  
  Parameters
  
  overwrite : bool
  Whether to overwrite existing direction values (default: False)
docstring_tokens: Add direction column and values to the trajectory ' s dataframe . The direction is calculated between the trajectory ' s start and end location . Direction values are in degrees starting North turning clockwise . Parameters overwrite : bool Whether to overwrite existing direction values ( default : False )
code: def add_direction(self, overwrite=False):
          """
          Add direction column and values to the trajectory's dataframe.
  
          The direction is calculated between the trajectory's start and end location.
          Direction values are in degrees, starting North turning clockwise.
  
          Parameters
          ----------
          overwrite : bool
              Whether to overwrite existing direction values (default: False)
          """
          if DIRECTION_COL_NAME in self.df.columns and not overwrite:
              raise RuntimeError('Trajectory already has direction values! Use overwrite=True to overwrite exiting values.')
          self._add_prev_pt()
          self.df[DIRECTION_COL_NAME] = self.df.apply(self._compute_heading, axis=1)
          self.df.at[self.get_start_time(), DIRECTION_COL_NAME] = self.df.iloc[1][DIRECTION_COL_NAME]
code_tokens: def add_direction ( self , overwrite = False ) : if DIRECTION_COL_NAME in self . df . columns and not overwrite : raise RuntimeError ( 'Trajectory already has direction values! Use overwrite=True to overwrite exiting values.' ) self . _add_prev_pt ( ) self . df [ DIRECTION_COL_NAME ] = self . df . apply ( self . _compute_heading , axis = 1 ) self . df . at [ self . get_start_time ( ) , DIRECTION_COL_NAME ] = self . df . iloc [ 1 ] [ DIRECTION_COL_NAME ]
short_docstring: Add direction column and values to the trajectory's dataframe.
short_docstring_tokens: Add direction column and values to the trajectory ' s dataframe .
comment: """
          Add direction column and values to the trajectory's dataframe.
  
          The direction is calculated between the trajectory's start and end location.
          Direction values are in degrees, starting North turning clockwise.
  
          Parameters
          ----------
          overwrite : bool
              Whether to overwrite existing direction values (default: False)
          """