Component¶
-
class
glue.core.component.Component(data, units=None)[source]¶ 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
Notes
Instead of instantiating Components directly, consider using
Component.autotyped(), which chooses a subclass most appropriate for the data type.Parameters: - data (
numpy.ndarray) – The data to store - units (str) – Optional unit label
Attributes Summary
categoricalWhether or not the datatype is categorical dataThe underlying numpy.ndarrayhiddenWhether the Component is hidden by default ndimThe number of dimensions numericWhether or not the datatype is numeric shapeTuple of array dimensions unitsMethods Summary
autotyped(data[, units])Automatically choose between Component and CategoricalComponent, based on the input data type. jitter([method])subset_from_roi(att, roi[, other_comp, ...])Create a SubsetState object from an ROI. to_series(**kwargs)Convert into a pandas.Series object. Attributes Documentation
-
categorical¶ Whether or not the datatype is categorical
-
data¶ The underlying
numpy.ndarray
Whether the Component is hidden by default
-
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)[source]¶ Automatically choose between Component and CategoricalComponent, based on the input data type.
Parameters: - data – The data to pack into a Component (array-like)
- units (str) – Optional units
Returns: A Component (or subclass)
-
subset_from_roi(att, roi, other_comp=None, other_att=None, coord='x')[source]¶ Create a SubsetState object from an ROI.
This encapsulates the logic for creating subset states with Components. See the documentation for CategoricalComponents for caveats involved with mixed-type plots.
Parameters: - att – attribute name of this Component
- roi – an ROI object
- other_comp – The other Component for 2D ROIs
- other_att – The attribute name of the other Component
- coord – The orientation of this Component
- is_nested – True if this was passed from another Component.
Returns: A SubsetState (or subclass) object
- data (