Description
Numpy RandomState
is now legacy ("This generator is considered frozen and will have no further improvement") and the documentation advises against using it:
This class should only be used if it is essential to have randoms that are identical to what would have been produced by previous versions of NumPy.
However, it sounds like RandomState
will always work:
It is guaranteed to produce the same values as the final point release of NumPy v1.16.
NEP19 also says
All current usages of RandomState will continue to work in perpetuity, though some may be discouraged through documentation.
numpy.random.Generator
was introduced in version 1.17 (specifically this PR) - our min dep is higher than this.
I don't have enough knowledge to know in what way the new generator is better (except for performance) but just asking as it is advised to not use the old one.
(Edit: for context saw this while working on #26958)