import numpy as np
np.zeros((5, 5))
array([[ 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0.]])
np.matrix([[1, 2],[3, 4]])
matrix([[1, 2],
[3, 4]])
np.matrix('1 2; 3 4')
np.arange(25).reshape((5, 5))
np.array(range(25)).reshape((5, 5))
np.ndarray((5, 5))
Get the dimensions of a numpy array:
x.shape