np.array python 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.)]) # note mix of tuple and lists,
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: numpy array input
n, m = map(int, input().split()) # taking number of rows and column
array = numpy.array([input().strip().split() for _ in range(n)], int)
Example 3: np in python
import numpy as np