convert_collection

convert_collection(X, output_type)[source]

Convert from one of collections compatible data structure to another.

See aeon.utils.conversion.COLLECTIONS_DATA_TYPE for the list.

Parameters:
Xcollection

The input collection to be converted.

output_typestring

Name of the target collection data type, must be one of COLLECTIONS_DATA_TYPES.

Returns:
Xcollection

Data structure conforming to output_type.

Raises:
TypeError if

X np.ndarray but wrong dimension X is list but not of np.ndarray or pd.DataFrame X is a pd.DataFrame of non float primitives

Examples

>>> from aeon.utils.conversion import convert_collection
>>> from aeon.utils.validation import get_type
>>> X=convert_collection(np.zeros(shape=(10, 3, 20)), "np-list")
>>> type(X)
<class 'list'>
>>> get_type(X)
'np-list'