import numpy as np
x = np.array([11, 13, 121, 181, 99, 100])
print('Numpy Array Elements',x)
print ('Minimum Value in array',x.min())
print ('Maximum Value in array',x.max())
print ('Index of Minimum Value',x.argmin())
print ('Index of Maximum Value',x.argmax())
print ('Mean of Array Values',x.mean())
print ('Median of Array Values',np.median(x))
print ('Standard deviation of Array Values',x.std())
Solve Problems by Coding Solutions - A Complete solution for python programming
Elementwise sum of two array elemets
import numpy as np
x = [[11,22],[33,44]]
y = [[55,66],[77,88]]
x1 = np.array([[11,22],[33,44]], dtype=np.int32)
y1 = np.array([[55,66],[77,88]], dtype=np.int32)
print("ADD USING LIST\n",x + y)
print("ADD NUMPY ARRAY\n",np.add(x1, y1))
x = [[11,22],[33,44]]
y = [[55,66],[77,88]]
x1 = np.array([[11,22],[33,44]], dtype=np.int32)
y1 = np.array([[55,66],[77,88]], dtype=np.int32)
print("ADD USING LIST\n",x + y)
print("ADD NUMPY ARRAY\n",np.add(x1, y1))
Subscribe to:
Posts (Atom)