LabeledDimensionΒΆ
A LabeledDimension is one where the coordinates along the dimension are string labels. You can similarly generate a labeled dimension.
Using the Dimension
class.
>>> import csdmpy as cp
>>> x = cp.Dimension(type='labeled',
... labels=['The', 'great', 'circle'])
>>> print(x)
LabeledDimension(['The' 'great' 'circle'])
Using the LabeledDimension
class.
>>> x = cp.LabeledDimension(labels=['The', 'great', 'circle'])
>>> print(x)
LabeledDimension(['The' 'great' 'circle'])
From numpy arrays or python list.
Use the as_dimension()
method to convert a numpy array as a
Dimension object.
>>> array = ['The', 'great', 'circle']
>>> x = cp.as_dimension(array)
>>> print(x)
LabeledDimension(['The' 'great' 'circle'])