Thursday, September 10, 2020

Python program to create an array using zeros and ones

 Python program to create an array using zeros and ones


 

 

  Python program to create an array

    using zeros() and ones()

=======================================

 

Code:

import numpy

a = zeros(10,int)

print(a)

b = ones(5)

print(b)

 

Output:

[ 0 0 0 0 0 ]

[1.0 1.0 1.0 1.0 1.0]

 

 

 


No comments:

Post a Comment

Durga Puja in Odisha

 Durga Puja in Odisha