diff options
author | Laurie <lastephey@lbl.gov> | 2020-07-12 15:50:15 -0700 |
---|---|---|
committer | Laurie <lastephey@lbl.gov> | 2020-07-12 15:50:15 -0700 |
commit | 746b0fcc3eb18d7c6f724d4553536b6fdab38c6e (patch) | |
tree | 5ea400b2cb4efec9e6e404770373c42421b4b4bd /doc/source/reference | |
parent | d88f217b26bf300dc0e5ecaf8e59b81f6a1d6e9d (diff) | |
download | numpy-746b0fcc3eb18d7c6f724d4553536b6fdab38c6e.tar.gz |
DOC: use print() instead of str() for generator object to pass circleci tests
Diffstat (limited to 'doc/source/reference')
-rw-r--r-- | doc/source/reference/random/index.rst | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/doc/source/reference/random/index.rst b/doc/source/reference/random/index.rst index 2ef9abdbf..b88e0f98b 100644 --- a/doc/source/reference/random/index.rst +++ b/doc/source/reference/random/index.rst @@ -105,8 +105,8 @@ random float: >>> import numpy as np >>> rng = np.random.default_rng(12345) ->>> str(rng) -'Generator(PCG64)' +>>> print(rng) +Generator(PCG64) >>> rfloat = rng.random() >>> rfloat 0.22733602246716966 @@ -143,12 +143,12 @@ The `Generator` is the user-facing object that is nearly identical to the legacy `RandomState`. It accepts a bit generator instance as an argument. The default is currently `PCG64` but this may change in future versions. As a convenience NumPy provides the `default_rng` funtion to hide these -details:: +details: >>> from numpy.random import default_rng >>> rg = default_rng(12345) ->>> str(rg) -'Generator(PCG64)' +>>> print(rg) +Generator(PCG64) >>> print(rg.random()) 0.22733602246716966 @@ -159,16 +159,16 @@ pass it to `Generator`: >>> from numpy.random import Generator, PCG64 >>> rg = Generator(PCG64(12345)) ->>> str(rg) -'Generator(PCG64)' +>>> print(rg) +Generator(PCG64) Similarly to use the older `MT19937` bit generator (not recommended), one can instantiate it directly and pass it to `Generator`: >>> from numpy.random import Generator, MT19937 >>> rg = Generator(MT19937(12345)) ->>> str(rg) -'Generator(MT19937)' +>>> print(rg) +Generator(MT19937) What's New or Different ~~~~~~~~~~~~~~~~~~~~~~~ |