np.array() code example
Example 1: how to make a numpy array
>>> x = np.array([2,3,1,0])
>>> x = np.array([2, 3, 1, 0])
>>> x = np.array([[1,2.0],[0,0],(1+1j,3.)])
and types
>>> x = np.array([[ 1.+0.j, 2.+0.j], [ 0.+0.j, 0.+0.j], [ 1.+1.j, 3.+0.j]])
Example 2: how to make an array python
this_is_a_list = [1, 2, 3]
import numpy
this_is_an_array = numpy.array([1, 2, 3])
Example 3: numpy array input
n, m = map(int, input().split())
array = numpy.array([input().strip().split() for _ in range(n)], int)
Example 4: numpy.array
import numpy as np
np.array(['A', 'B', 'C'])