Articles → NUMPY → Arrays Of Ones In Numpy

Arrays Of Ones In Numpy






Purpose





Example




import numpy as np

print(np.ones(5)) # Single dimensional array


Picture showing the one dimensional array in numpy
Click to Enlarge

import numpy as np

print(np.ones((2, 3))) # Two dimensional array


Picture showing the two dimensional array in numpy
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, March 20, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250