Why is the numpy random.choice () function terminated?

I worked with numpy and needed the random.choice () function. Unfortunately, in version 2.0 it is not in random or random.trand.RandomState modules. Was he expelled for a specific reason? There is nothing in the discussion or documentation about this!

For information, I am running Numpy 2.0 on python 2.7 on mac os. All of them are installed on standard installers located on sites.

Thanks!

+8
python numpy scipy
source share
1 answer

random.choice - as far as I can talk about part of python itself, and not about numpy. Are you import random ?

Update: numpy 1.7 has added a new function numpy.random.choice . Obviously, for this you need numpy 1.7.

Update2: it seems like in unreleased numpy 2.0 it was temporarily called numpy.random.sample . It has been renamed. That is why when using unreleased versions, you really need to take a look at the API ( pydoc numpy.random ) and change the log.

+8
source share

All Articles