I'm learning Numpy module from scratch going through the official Numpy documentation.
Now my goal is to create a random (3, 3) array.
>>> np.random.rand(3,3)
However the output I recieved is a bunch of random float values.
array([[ 0.33519419, 0.53502883, 0.35485002],
[ 0.73419236, 0.85315716, 0.64135169],
[ 0.51732791, 0.27411508, 0.32482598]])
I wonder how can I do the same with int
Referring the Official documentation of Numpy for the numpy.random.rand
here I don't find a clue on converting or specifying the data type from float values to integer.
How can I achieve random values in int
?
Aucun commentaire:
Enregistrer un commentaire