code: def add_manual_segmentation_to_data_frame(self, data_frame, segmentation_dictionary):
          
          
          # add some checks to see if dictionary is in the right format!
          
          data_frame['segmentation'] = 'unknown'
          
          for i, (k, v) in enumerate(segmentation_dictionary.items()):
              for start, end in v:                
                  if type(start) != np.datetime64:
                      if start < 0: start = 0
                      if end > data_frame.size: end = data_frame.size
                      
                      start = data_frame.index.values[start]
                      end = data_frame.index.values[end]
                      
                  data_frame.loc[start: end, 'segmentation'] = k
          
          return data_frame
docs: Utility method to store manual segmentation of gait time series.
  
              :param data_frame: The data frame. It should have x, y, and z columns.
              :type data_frame: pandas.DataFrame
              :param segmentation_dictionary: A dictionary of the form {'signal_type': [(from, to), (from, to)], ..., 'signal_type': [(from, to), (from, to)]}. The from and to can either be of type numpy.datetime64 or int, depending on how you are segmenting the time series.
              :type segmentation_dictionary: dict
              :return: The data_frame with a new column named 'segmentation'.
              :rtype: pandas.DataFrame