BaseColumnInfo¶
-
class
astropy.utils.data_info.BaseColumnInfo(bound=False)[source]¶ Bases:
astropy.utils.data_info.DataInfoBase info class for anything that can be a column in an astropy Table. There are at least two classes that inherit from this:
ColumnInfo: for native astropy Column / MaskedColumn objects MixinInfo: for mixin column objectsNote that this class is defined here so that mixins can use it without importing the table package.
Attributes Summary
attr_namesMethods Summary
adjust_indices(index, value, col_len)Adjust info indices after column modification. iter_str_vals()This is a mixin-safe version of Column.iter_str_vals. merge_cols_attributes(cols, …)Utility method to merge and validate the attributes attrsfor the input table columnscols.slice_indices(col_slice, item, col_len)Given a sliced object, modify its indices to correctly represent the slice. Attributes Documentation
-
attr_names= {'description', 'dtype', 'parent_table', 'unit', 'indices', 'meta', 'name', 'format'}¶
Methods Documentation
-
adjust_indices(index, value, col_len)[source]¶ Adjust info indices after column modification.
Parameters: - index : slice, int, list, or ndarray
Element(s) of column to modify. This parameter can be a single row number, a list of row numbers, an ndarray of row numbers, a boolean ndarray (a mask), or a column slice.
- value : int, list, or ndarray
New value(s) to insert
- col_len : int
Length of the column
-
static
merge_cols_attributes(cols, metadata_conflicts, name, attrs)[source]¶ Utility method to merge and validate the attributes
attrsfor the input table columnscols.Note that
dtypeandshapeattributes are handled specially. These should not be passed inattrsbut will always be in the returned dict of merged attributes.Parameters: - cols : list
List of input Table column objects
- metadata_conflicts : str (‘warn’|’error’|’silent’)
How to handle metadata conflicts
- name : str
Output column name
- attrs : list
List of attribute names to be merged
Returns: - attrs : dict of merged attributes
-