summaryrefslogtreecommitdiff
path: root/doc/source/reference/random/new-or-different.rst
diff options
context:
space:
mode:
Diffstat (limited to 'doc/source/reference/random/new-or-different.rst')
-rw-r--r--doc/source/reference/random/new-or-different.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/source/reference/random/new-or-different.rst b/doc/source/reference/random/new-or-different.rst
index b3bddb443..4b9ba72a4 100644
--- a/doc/source/reference/random/new-or-different.rst
+++ b/doc/source/reference/random/new-or-different.rst
@@ -114,3 +114,14 @@ And in more detail:
rg.random(out=existing[:2])
print(existing)
+* Optional ``axis`` argument for methods like `~.Generator.choice` and
+ `~.Generator.shuffle` to control which axis an operation is performed
+ over for higher-dimensional arrays.
+
+.. ipython:: python
+
+ a = np.arange(12).reshape((3, 4))
+ a
+ rg.choice(a, axis=1, size=2)
+ rg.shuffle(a, axis=1) # Shuffle in-place
+ a