Component#
- class glue.core.component.Component(data, units=None)#
Bases:
objectStores the actual, numerical information for a particular quantity
Data objects hold one or more components, accessed via ComponentIDs. All Components in a data set must have the same shape and number of dimensions
- Parameters:
- data
ndarray The data to store.
- unitsstr, optional
Unit label.
- data
Notes
Instead of instantiating Components directly, consider using
Component.autotyped(), which chooses a subclass most appropriate for the data type.Attributes Summary
Whether or not the datatype is categorical.
The underlying
ndarrayWhether or not or not the datatype is a date/time
Whether or not or not the datatype represents an extended region
The number of dimensions
Whether or not the datatype is numeric.
Tuple of array dimensions
Methods Summary
autotyped(data[, units])Automatically choose between Component and CategoricalComponent, based on the input data type.
jitter([method])to_series(**kwargs)Convert into a pandas.Series object.
Attributes Documentation
- categorical#
Whether or not the datatype is categorical.
- datetime#
Whether or not or not the datatype is a date/time
- extended#
Whether or not or not the datatype represents an extended region
- ndim#
The number of dimensions
- numeric#
Whether or not the datatype is numeric.
- shape#
Tuple of array dimensions
- units#
Methods Documentation
- classmethod autotyped(data, units=None)#
Automatically choose between Component and CategoricalComponent, based on the input data type.
- Parameters:
- dataarray-like
The data to pack into a Component.
- unitsstr, optional
Unit description.
- Returns:
Component(or subclass)
- jitter(method=None)#
- to_series(**kwargs)#
Convert into a pandas.Series object.
- Parameters:
- **kwargs
All kwargs are passed to the Series constructor.
- Returns
- ——-
- :class:`pandas.Series`