-
-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Description
Output of integers() with dtype=int8 appears to be less uniform that one could expect it to.
import matplotlib.pyplot as plt
import numpy as np
samples = np.random.default_rng().integers(31, size=1111111, dtype=np.int8)
values, counts = np.unique(samples, return_counts=True)
plt.vlines(values, 0, counts)
plt.show()Similar periodicity shows up with various static seeds and MT19937; flipping the use_masked flag in random_bounded_uint8_fill() results in all values having approximately equal frequencies.
Same for 1.17 and 1.18.0.dev0+c10d66a 3.7.3 (default, Oct 7 2019, 12:56:13) [GCC 8.3.0].
