Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy
- a=numpy.ndarray(3,numpy.float)
- #print a
- b=numpy.array([1.2,0.2,-0.6])
- #print b
- #print type (a)
- #print type (b)
- #print a.shape
- c=numpy.array([1.3,2.0,1.4])
- d=c+b
- #print d
- #print d*10
- e=b+c
- #print c+b==b+c
- #print (b+(c+d)) - ((b+c)+d)
- zero=numpy.array([0,0,0])
- #print zero.dtype
- #print zero+b==b
- x=numpy.array([1.2,2.3,3.4])
- x_=numpy.array([-1.2,-2.3,-3.4])
- #print x+x_
- #print 1*(3*x) == (1*3)*x
- #print (2.1+3.2)*x == (2.1*x)+(3.2*x)
- print numpy.linalg.norm(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement