From the documentation for numpy’s random.Generator.choice
function, one of the arguments is shuffle
, which defaults to True
.
The documentation states:
shuffle bool, optional
Whether the sample is shuffled when sampling without replacement. Default is True, False provides a speedup.
There isn’t enough information for me to figure out what this means. I don’t understand why we would shuffle if it’s already appropriately random, and I don’t understand why I would be given the option to not shuffle if that yields a biased sample.
If I set shuffle
to False
am I still getting a random (independent) sample? I’d love to also understand why I would ever want the default setting of True
.
0