samedi 19 février 2022

Can anybody explain why numpy doesn't always include sampling with replacement?

I've been looking for a proper way to random sample a set of integers without replacement, like I would do with ease in R, but I can't find anything.

I've been reading the documentation recommending me to use Generator, but with no luck: https://numpy.org/doc/stable/reference/random/index.html

I can use

np.random.choice([0,1,2,3], size=10, replace=False, p=None

, but I think numpy wants me to write new code with that new Generator. Slightly confused here.




Aucun commentaire:

Enregistrer un commentaire