From 746b0fcc3eb18d7c6f724d4553536b6fdab38c6e Mon Sep 17 00:00:00 2001 From: Laurie Date: Sun, 12 Jul 2020 15:50:15 -0700 Subject: DOC: use print() instead of str() for generator object to pass circleci tests --- doc/source/reference/random/index.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'doc/source/reference') 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 ~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.1