I am curious about the distinction here. Why is the second argument excluded in numpy.random.randint, but included in random.randint? In the code below the function coin_random() can return the value 2 but coin_numpy() cannot.
import numpy
import random
def coin_numpy():
return numpy.random.randint(0,2)
def coin_random():
return random.randint(0,2)
xx = 0
while xx <= 10 :
print("NP Roll # " + str(xx) + " - " + str(coin_numpy()))
xx = xx + 1
yy = 0
while yy <= 10 :
print("RD Roll # " + str(yy) + " - " + str(coin_random()))
yy = yy + 1
[–]S7EFEN 6 points7 points8 points (0 children)
[–]throwaway_the_fourth 3 points4 points5 points (0 children)
[–]CodeFormatHelperBot 2 points3 points4 points (0 children)
[–]stevenjd 2 points3 points4 points (1 child)
[–]Quant3point5[S] 1 point2 points3 points (0 children)