diff options
author | Ross Barnowski <rossbar@berkeley.edu> | 2020-04-25 12:55:52 -0700 |
---|---|---|
committer | Ross Barnowski <rossbar@berkeley.edu> | 2020-04-25 13:06:51 -0700 |
commit | 63673a81d910c42aae60d6489674cdbd8c7b664e (patch) | |
tree | 40ccbf010d016bf41565dba55686daf8b260c788 | |
parent | 228e1931703c8fe720a0e40116bf9c48a2337151 (diff) | |
download | numpy-63673a81d910c42aae60d6489674cdbd8c7b664e.tar.gz |
DOC: Added `permutation` to methods with axis kwarg.
Added `permutation` to `choice` and `shuffle` in the list of
highlighted methods with an `axis` kwarg.
-rw-r--r-- | doc/source/reference/random/index.rst | 4 | ||||
-rw-r--r-- | doc/source/reference/random/new-or-different.rst | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/doc/source/reference/random/index.rst b/doc/source/reference/random/index.rst index 79e6a285e..d559f2327 100644 --- a/doc/source/reference/random/index.rst +++ b/doc/source/reference/random/index.rst @@ -169,8 +169,8 @@ What's New or Different * All BitGenerators in numpy use `SeedSequence` to convert seeds into initialized states. * The addition of an ``axis`` keyword argument to methods such as - `Generator.choice` and `Generator.shuffle` improves support for - sampling from and shuffling multi-dimensional arrays. + `Generator.choice`, `Generator.permutation`, and `Generator.shuffle` + improves support for sampling from and shuffling multi-dimensional arrays. See :ref:`new-or-different` for a complete list of improvements and differences from the traditional ``Randomstate``. diff --git a/doc/source/reference/random/new-or-different.rst b/doc/source/reference/random/new-or-different.rst index 4b9ba72a4..43428f8a8 100644 --- a/doc/source/reference/random/new-or-different.rst +++ b/doc/source/reference/random/new-or-different.rst @@ -114,14 +114,15 @@ 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. +* Optional ``axis`` argument for methods like `~.Generator.choice`, + `~.Generator.permutation` and `~.Generator.shuffle` that controls which + axis an operation is performed over for multi-dimensional arrays. .. ipython:: python + rg = Generator(PCG64(123456789)) a = np.arange(12).reshape((3, 4)) a - rg.choice(a, axis=1, size=2) + rg.choice(a, axis=1, size=5) rg.shuffle(a, axis=1) # Shuffle in-place a |