write a program in python to create array of 10 elements using zeros() and ones()
write a program in python to create array of 10
elements using zeros() and ones()
=================================
code
import numpy
a = zeros(10,int)
print(a)
b = ones(10)
print(b)
output
[ 0 0 0 0 0 0 0 0 0 0 ]
[1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0]
No comments:
Post a Comment