astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- Astropy Core Package Utilities (`astropy.utils`) »
- data_info_factory

# data_info_factory

astropy.utils.data_info.data_info_factory(names, funcs)

  Factory to create a function that can be used as an `option` for outputting data object summary information.

  Parameters:
    names `python:list`

      List of information attribute names

    funcs `python:list`

      List of functions that compute the corresponding information attribute

  Returns:
    func python:function

      Function that can be used as a data info option

  Examples

      >>> from astropy.utils.data_info import data_info_factory
      >>> from astropy.table import Column
      >>> c = Column([4., 3., 2., 1.])
      >>> mystats = data_info_factory(names=['min', 'median', 'max'],
      ...                             funcs=[np.min, np.median, np.max])
      >>> c.info(option=mystats)
      min = 1
      median = 2.5
      max = 4
      n_bad = 0
      length = 4