Closed wasade closed 1 year ago
Thanks, @wasade. How much work would it be to rewrite the random shuffling into the new NumPy random API? Setting seed with np.random.seed
is now a legacy function that sets the global random seed which can have some unintended consequences. The new RNG documentation is here.
Good observation. Likely easy given the methods are there but the signature for the underlying cython method will need a minor adjustment
>>> from numpy.random import default_rng
>>> rng = default_rng(12345)
>>> rng.multinomial
<built-in method multinomial of numpy.random._generator.Generator object at 0x7f9c385c1900>
>>> rng.permutation
<built-in method permutation of numpy.random._generator.Generator object at 0x7f9c385c1900>
>>>
@gibsramen if this is green can you merge?
Looks good, thanks! I think this is good to merge.
Thanks!
Fixes #914. You can now specify the random seed on call to
Table.subsample(...)
.cc @gibsramen @rob-knight