# Basic syntax:
numpy_array.tolist()
# Example usage:
your_array = np.array([[1, 2, 3], [4, 5, 6]])
your_array
--> array([[1, 2, 3],
[4, 5, 6]])
your_array.tolist()
--> [[1, 2, 3], [4, 5, 6]]
import numpy as np
# 1d array to list
arr = np.array([1, 2, 3])
print(f'NumPy Array:
{arr}')
#NumPy Array: [1 2 3]
list1 = arr.tolist()
print(f'List: {list1}')
#List: [1, 2, 3]
import numpy as np
npa = np.asarray(Lists, dtype=np.float32)
import numpy as np
x = np.matrix([[1,2,3],
[7,1,3],
[9,4,3]])
y = x.tolist()
y --> [[1, 2, 3], [7, 1, 3], [9, 4, 3]]
x=[[1,2],[1,2,3],[1]]
y=numpy.array([numpy.array(xi) for xi in x])
type(y)
# <type 'numpy.ndarray'>
type(y[0])
# <type 'numpy.ndarray'>
np.concatenate( list_of_array, axis=0 )