I was addicted to the library that is often used in Python. Take a look at the simple code that can be executed in the following Google Collaboratory. It's just calling a popular, widely used library It looks exactly the same in the formula, That the output results are similar but actually different.
We need some caution when using randint whether this function is called from random library or numpy library. The result will be very different !!
import random
import numpy as np
for i in range (500):
print (np.random.randint(0,37))
for j in range (500):
print (random.randint(0,37))
In the case of random called with numpy, only 0 to 36 are output. On the other hand, if you call random without numpy, it will be 0 ~ 37!
Why did you notice Previously, I posted an article that verified whether I could make money at the casino. It has been pointed out that the random results may be different, After investigating np.random.randint (a, b) and random.randint (a, b) It turns out that the analysis result of is completely different! The result is the exact opposite (;;) (T.T) With such a simple formula that seems to be used normally It's confusing that you end up with completely different analysis results! I've never seen the alert material online.
It may happen that the behavior of the code that you normally use changes just by putting it at the beginning. No, it should definitely be there if you are using the library! learned a lot!
Original article: https://qiita.com/mnoda/items/3a0d1f6e21b52bbf79d0#comment-904693840460457f4ae3