code: def apply(self, func, ids=None, applyto='measurement',
                output_format='DataFrame', noneval=nan,
                setdata=False, dropna=False, ID=None):
          
          _output = 'collection' if output_format == 'collection' else 'dict'
          result = super(OrderedCollection, self).apply(func, ids, applyto,
                                                        noneval, setdata,
                                                        output_format=_output)
  
          # Note: result should be of type dict or collection for the code
          # below to work
          if output_format is 'dict':
              return result
          elif output_format is 'DataFrame':
              return self._dict2DF(result, noneval, dropna)
          elif output_format is 'collection':
              return result
          else:
              msg = ("output_format must be either 'dict' or 'DataFrame'. " +
                     "Encountered unsupported value %s." % repr(output_format))
              raise Exception(msg)
docs: Apply func to each of the specified measurements.
  
          Parameters
          ----------
          func : callable
              Accepts a Measurement object or a DataFrame.
          ids : hashable| iterable of hashables | None
              Keys of measurements to which func will be applied.
              If None is given apply to all measurements.
          applyto :  'measurement' | 'data'
              'measurement' : apply to measurements objects themselves.
              'data'        : apply to measurement associated data
          output_format: ['DataFrame' | 'dict' | 'collection']
          noneval : obj
              Value returned if applyto is 'data' but no data is available.
          setdata : bool
              Whether to set the data in the Measurement object.
              Used only if data is not already set.
          dropna : bool
              whether to remove rows/cols that contain no measurements.
          ID : [None | str | numeric]
              ID is used as the new ID for the collection.
              If None, then the old ID is retained.
              Note: Only applicable when output is a collection.
  
          Returns
          -------
          DataFrame/Dictionary/Collection containing the output of func for each Measurement.