CategoricalComponent#
- class glue.core.component.CategoricalComponent(categorical_data, categories=None, jitter=None, units=None)[source]#
Bases:
Component
Container for categorical data.
- Parameters:
- categorical_data
ndarray
The underlying array.
- categoriesiterable, optional
List of unique values in the data.
- jitterstr, optional
Strategy for jittering the data.
- unitsstr, optional
Unit description.
- categorical_data
Attributes Summary
Whether or not the datatype is categorical.
The categories.
The index of the category for each value in the array.
The underlying
ndarray
The original categorical data.
Whether or not the datatype is numeric.
Methods Summary
jitter
([method])Jitter the codes so the density of points can be easily seen in a scatter plot for example.
to_series
(**kwargs)Convert into a pandas.Series object.
Attributes Documentation
Methods Documentation
- jitter(method=None)[source]#
Jitter the codes so the density of points can be easily seen in a scatter plot for example.
- Parameters:
- method{None, ‘uniform’}
If None, no jittering is done (or any jittering is undone). If
'uniform'
, the codes are randomized by a uniformly distributed random variable.