code: def segment_taper_rates(neurites, neurite_type=NeuriteType.all):
      '''taper rates of the segments in a collection of neurites
  
      The taper rate is defined as the absolute radii differences divided by length of the section
      '''
      def _seg_taper_rates(sec):
          '''vectorized taper rates'''
          pts = sec.points[:, COLS.XYZR]
          diff = np.diff(pts, axis=0)
          distance = np.linalg.norm(diff[:, COLS.XYZ], axis=1)
          return np.divide(2 * np.abs(diff[:, COLS.R]), distance)
  
      return map_segments(_seg_taper_rates, neurites, neurite_typef segment_taper_rates(neurites, neurite_type=NeuriteType.all):
      '''taper rates of the segments in a collection of neurites
  
      The taper rate is defined as the absolute radii differences divided by length of the section
      '''
      def _seg_taper_rates(sec):
          '''vectorized taper rates'''
          pts = sec.points[:, COLS.XYZR]
          diff = np.diff(pts, axis=0)
          distance = np.linalg.norm(diff[:, COLS.XYZ], axis=1)
          return np.divide(2 * np.abs(diff[:, COLS.R]), distance)
  
      return map_segments(_seg_taper_rates, neurites, neurite_type)
docs: taper rates of the segments in a collection of neurites
  
      The taper rate is defined as the absolute radii differences divided by length of the section