import numpy as np
a = np.arange(15).reshape(3, 5)
a
a.shape
#the number of axes (dimensions) of the arraya.ndim#维度
a.dtype.name
#the total number of elements of the array
a.size
np.zeros ((3,4))
np.ones( (2,3,4), dtype=np.int32 )
#Tocreate sequences of numbers
np.arange( 10, 30, 5 )
np.arange( 0, 2, 0.3 )
np.arange(12).reshape(4,3)
np.random.random((2,3))
from numpy import pi
np.linspace( 0, 2*pi, 100 )
np.sin(np.linspace( 0, 2*pi, 100 ))
#the product operator * operates elementwise in NumPy arrays
a = np.array( [20,30,40,50] )
b = np.arange( 4 )
#print a #print b#b
c = a-b
#print c
b**2#print b**2
print a<35
#The matrix product can be performed using the dot functionormethodA = np.array( [[1,1],
[0,1]] )
B = np.array( [[2,0],
[3,4]] )
print A
print B
#print A*B
print A.dot(B)
print np.dot(A, B)
import numpy as npa = np.arange(15).reshape(3, 5)aa.shape#the number of axes (dimensions) of the arraya.ndim#维度a.dtype.name#the total number of elements of the arraya.sizenp.zeros ((3,4)) np.ones(