how to define a numpy array in python code example
Example 1: numpy array from list
>>> a = [1, 2]
>>> np.asarray(a)
array([1, 2])
Example 2: numpy init array
a=[]
for i in range(8):
a.append(i)
>>> a = [1, 2]
>>> np.asarray(a)
array([1, 2])
a=[]
for i in range(8):
a.append(i)