DataInfo#
- class astropy.utils.data_info.DataInfo(bound=False)[source]#
 Bases:
objectDescriptor that data classes use to add an
infoattribute for storing data attributes in a uniform and portable way. Note that it must be calledinfoso that the DataInfo() object can be stored in theinstanceusing theinfokey. Because owner_cls.x is a descriptor, Python doesn’t use __dict__[‘x’] normally, and the descriptor can safely store stuff there. Thanks to https://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb for this trick that works for non-hashable classes.- Parameters:
 - boundbool
 If True this is a descriptor attribute in a class definition, else it is a DataInfo() object that is bound to a data object instance. Default is False.
Attributes Summary
Methods Summary
__call__([option, out])Write summary information about data object to the
outfilehandle.info_summary_stats(dat)Attributes Documentation
- attr_names = {'description', 'dtype', 'format', 'meta', 'name', 'unit'}#
 
- attrs_from_parent = {}#
 
- description#
 
- dtype#
 
- format#
 
- meta#
 
- name#
 
- unit#
 
Methods Documentation
- __call__(option='attributes', out='')[source]#
 Write summary information about data object to the
outfilehandle. By default this prints to standard output via sys.stdout.The
optionargument specifies what type of information to include. This can be a string, a function, or a list of strings or functions. Built-in options are:attributes: data object attributes likedtypeandformatstats: basic statistics: min, mean, and max
If a function is specified then that function will be called with the data object as its single argument. The function must return an OrderedDict containing the information attributes.
If a list is provided then the information attributes will be appended for each of the options, in order.
- Parameters:
 - option
python:str,python:callable(),python:listof (python:strorpython:callable()) Info option, defaults to ‘attributes’.
- outpython:file-like object, 
python:None Output destination, defaults to sys.stdout. If None then the OrderedDict with information attributes is returned
- option
 - Returns:
 - info
OrderedDictorpython:None OrderedDictif out==None else None
- info
 
Examples
>>> from astropy.table import Column >>> c = Column([1, 2], unit='m', dtype='int32') >>> c.info() dtype = int32 unit = m class = Column n_bad = 0 length = 2
>>> c.info(['attributes', 'stats']) dtype = int32 unit = m class = Column mean = 1.5 std = 0.5 min = 1 max = 2 n_bad = 0 length = 2
- static info_summary_attributes(dat)#
 
- static info_summary_stats(dat)#