You can clone with
HTTPS or Subversion.
random.choice enhancement request:
random.choice should support multidimensional arrays by taking an axis number. With this enhancement, axis=None would choose from a flattened array, while an integer argument would chose from the subarrays along that axis.
Apologies if this is a duplicate. My previous submission seems to have vanished.
This should be simple if you are thinking about doing it. All that seems necessary is to add a special check for axis=None and ravel in that case and replace make axis=1. Then set pop_size = a.shape[axis] and pass axis into take. (Plus possibly an error if a is just an int and axis is given).
pop_size = a.shape[axis]
Actually thinking about it, it could also be reasonable to have size=None as default and have it return a scalar/the given axes removed in that case. That would be a real change in functionality unfortunately, but it would make sense for similarity to import random; random.choice mostly.
import random; random.choice
One could think about also allowing an out argument which is just passed into take mostly. While none of the other random functions have that it could be a nice performance option in some cases.