dimanche 30 janvier 2022

numpy randint arguments exclusive

In the official NumPy documentation (https://numpy.org/doc/stable/reference/random/generated/numpy.random.randint.html), it describes its second argument as exclusive.

random.randint(low, high=None, size=None, dtype=int)
    Return random integers from low (inclusive) to high (exclusive).

Then I though random.randint(1, 5) returns values 1, 2, 3, or 4, but it actually gives values among 1, 2, 3, 4, and 5.

What went wrong?




Aucun commentaire:

Enregistrer un commentaire