Danger

randomgen has been substantially merged into NumPy as of 1.17. Evolution of randomgen details how randomgen has changed since it was incorporated into NumPy.

RandomGen¶

This package contains additional bit generators for NumPy’s Generator and an ExtendedGenerator exposing methods not in Generator.

Introduction¶

randomgen supplies many bit generators that can be used with numpy.random.Generator. It also supports additional variants of the bit generators included in NumPy.

from numpy.random import Generator
from randomgen import AESCounter
rg = Generator(AESCounter())
rg.random()


Seed information is directly passed to the bit generator.

rg = Generator(AESCounter(12345, mode="sequence"))
rg.random()


History¶

randomgen began as a project to modernize NumPy’s RandomState. It has succeed at this goal. Some of the components on randomgen were deemed too exotic to include with NumPy and so have been retained in randomgen. Most of these are bit generators or extended features of bit generators included with NumPy. In addition randomgen.generator.ExtendedGenerator exposes some methods that are not included in Generator.

What’s New or Different¶

See What’s New or Different for a complete list of improvements and differences.

Parallel Generation¶

The included generators can be used in parallel, distributed applications in one of five ways:

Supported Generators¶

The main innovation is the inclusion of a number of alternative pseudo-random number generators, ‘in addition’ to the standard PRNG in NumPy. The included PRNGs are: