# add vectors
from numpy import array
a = array([1, 2, 3])
print(a)
b = array([1, 2, 3])
print(b)
c = a + b
print(c)
In [2]:
print(type(c))
In [3]:
d=array([4,5,6])
e=array([1,2,3])
f=d-e
print(f)
In [4]:
g=a/b
print(g)
In [5]:
#vector multiplication
h=d*e
print(h)
In [6]:
# vector-scalar multiplication
from numpy import array
a = array([1, 2, 3])
print(a)
s = 0.5
print(s)
c = s * a
print(c)
In [ ]:
No comments:
Post a Comment