Python‎ > ‎numpy‎ > ‎

ones


 The np.ones() created the matrix and reduced to 1 value and parent method calculated the sin and cos of matrix.
import numpy

a=np.cos(np.ones((2,3), dtype=int))

b=np.sin(np.ones((2,3), dtype=int))
print(a*b[0])
 [[0.45464871 0.45464871 0.45464871] [0.45464871 0.45464871 0.45464871]]


Comments