ENH/DOC: remove references to np.random.RandomState in favour of np.random.Generator #5342
Labels
⏩ type: Enhancement
Improve existing features
🔍 Monitor
This ticket's outcome is dependent on an external condition; monitor it.
Description
Once NumPy minimal version is set to 1.17 #5340, I propose to do a PR to remove from the documentation/code any reference to
RandomState
and wrong (not best practice) usage of random number generators.We went through this in SciPy (doc part for now). More on the PR scipy/scipy#13778
Additional context
Since NumPy 1.17, the canonical way to create random numbers is:
And If a seed is to be used. User should not use a common value such as 0 or 123456. This is to prevent bias (everyone is using the same values) and ensure sufficient entropy for the generator. More details. The good practice (from NumPy's doc) is to generate a seed like this:
Then you can use the value like
The text was updated successfully, but these errors were encountered: