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.
Anony-mousse
source share