summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2020-04-25 09:40:06 -0600
committerGitHub <noreply@github.com>2020-04-25 09:40:06 -0600
commit59984a3596e00e088b10c58f02856e8088fcd4df (patch)
tree71e75613c5dfa9e5e6d0416bdb522b0cdb884987
parent6ee49178517088966e63c2aedf6a8a5779ad5384 (diff)
parentfbe082d6aeb9356107906a66ec3879d42c4d2638 (diff)
downloadnumpy-59984a3596e00e088b10c58f02856e8088fcd4df.tar.gz
Merge pull request #16075 from rgommers/doc-choice
DOC: add a note on sampling 2-D arrays to random.choice docstring
-rw-r--r--numpy/random/mtrand.pyx5
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/random/mtrand.pyx b/numpy/random/mtrand.pyx
index 540e19ec6..0c0c611af 100644
--- a/numpy/random/mtrand.pyx
+++ b/numpy/random/mtrand.pyx
@@ -848,6 +848,11 @@ cdef class RandomState:
randint, shuffle, permutation
Generator.choice: which should be used in new code
+ Notes
+ -----
+ Sampling random rows from a 2-D array is not possible with this function,
+ but is possible with `Generator.choice` through its ``axis`` keyword.
+
Examples
--------
Generate a uniform random sample from np.arange(5) of size 3: