get_type¶
- get_type(X, raise_error=True)[source]¶
Get the string identifier associated with different collection data structures.
- Parameters:
- Xcollection
See aeon.utils.data_types.COLLECTIONS_DATA_TYPES for details.
- raise_errorbool, default=True
If True, raise a ValueError if the input is not a valid type. If False, returns None when an error would be raised.
- Returns:
- input_typestring
One of COLLECTIONS_DATA_TYPES.
- Raises:
- ValueError
X np.ndarray but does not have 2 or 3 dimensions. X is a list but not of np.ndarray or pd.DataFrame or contained data has an inconsistent number of channels. X is a pd.DataFrame of non-float primitives. X is not a valid type. Only if raise_error is True.
Examples
>>> from aeon.utils.validation.collection import get_type >>> get_type(np.zeros(shape=(10, 3, 20))) 'numpy3D'
Deprecated since version 1.3.0: get_type imported from utils.validation is deprecated and will be removed in v1.4.0. Import from aeon.utils.validation.collection instead.