aixd.data.utils_data.reformat_list_to_array
- aixd.data.utils_data.reformat_list_to_array(nested_list: List[List]) ndarray [source]
Reformats data formatted as a nested list into a numpy.ndarray. In the intended use, an item in the main list corresponds to a data sample and to a row in the array. The data in the sub-lists must be flattened (no further sub-lists).
- Parameters:
nested_list (List[List]) – List of lists, max. depth: 2 (data correspodning to data objects with dim > 1 must be flattened.)
- Returns:
np.ndarray – A numpy ndarray.
Examples
>>> nested_list = [[1,2,3],[7,8,9]] >>> print(reformat_list_to_array(nested_list)) [[1 2 3] [7 8 9]]