The numpy.random module defines the following 4 functions that all seem to return a float betweeb [0, 1.0) from the continuous uniform distribution. What (if any) is the differe
I got different answers.
print(np.random.random)
print(np.random.ranf)
print(np.random.sample)
print(np.random.rand)
print(np.random.random_sample is np.random.random)
print(np.random.random_sample is np.random.ranf)
print(np.random.random_sample is np.random.sample)
<built-in method random of numpy.random.mtrand.RandomState object at 0x000001FC2C459D08>
<built-in function ranf>
<built-in function sample>
<built-in method rand of numpy.random.mtrand.RandomState object at 0x000001FC2C459D08>
False
False
False
Nothing.
They're just aliases to random_sample
:
In [660]: np.random.random
Out[660]: <function random_sample>
In [661]: np.random.ranf
Out[661]: <function random_sample>
In [662]: np.random.sample
Out[662]: <function random_sample>
In [663]: np.random.random_sample is np.random.random
Out[663]: True
In [664]: np.random.random_sample is np.random.ranf
Out[664]: True
In [665]: np.random.random_sample is np.random.sample
Out[665]: True