data_info_factory#

astropy.utils.data_info.data_info_factory(names, funcs)[source]#

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

Parameters:
nameslist

List of information attribute names

funcslist

List of functions that compute the corresponding information attribute

Returns:
funcfunction

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