numpy.random.Generator.choice method random.Generator.choice(a, size=None, replace=True, p=None, axis=0, shuffle=True) Generates a random sample from a given array