mercredi 2 août 2017

Python numpy random numbers probability

Python 3.6.1 :: Anaconda custom (64-bit)

import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mtptlb

print (np.__version__)
1.12.1
print (mtptlb.__version__)
2.0.2

%matplotlib inline
a=np.random.uniform(1,100,1000000)
b=range(1,101)
plt.hist(a)

enter image description here

Why does the Y axis show 100000? np.random.uniform(1,100,1000000) has the value 1000000, so shouldn't it show 1000000 on y axis?




Aucun commentaire:

Enregistrer un commentaire