Up to date

This page is up to date for NumDot stable. If you still find outdated information, please open an issue.

NDRandomGenerator๏ƒ

Inherits: RefCounted

An object for generating random values.

Description๏ƒ

An object for generating random values. Given a specific seed, it is perfectly deterministic.

Create instances through nd.default_rng().

Methods๏ƒ

NDArray

integers(low_or_high: int = 0, high: Variant = null, shape: Variant = PackedByteArray(), dtype: DType = 8, endpoint: bool = false)

NDArray

randn(shape: Variant = PackedByteArray(), dtype: DType = 2)

NDArray

random(shape: Variant = PackedByteArray(), dtype: DType = 2)

Array[NDRandomGenerator]

spawn(n: int)


Method Descriptions๏ƒ

NDArray integers(low_or_high: int = 0, high: Variant = null, shape: Variant = PackedByteArray(), dtype: DType = 8, endpoint: bool = false) ๐Ÿ”—

Return random integers sampled from the โ€œdiscrete uniformโ€ distribution of the specified dtype. If high is None (the default), then results are from 0 to low.


NDArray randn(shape: Variant = PackedByteArray(), dtype: DType = 2) ๐Ÿ”—

Return random integers sampled from the standard normal distribution N(0, 1) of the specified dtype. A general gaussian distribution N(mu, sig) may be obtained by multiplying the result with sig and adding it with mu.


NDArray random(shape: Variant = PackedByteArray(), dtype: DType = 2) ๐Ÿ”—

Return random floats in the half-open interval [0.0, 1.0).


Array[NDRandomGenerator] spawn(n: int) ๐Ÿ”—

Create new independent child generators.


User-contributed notes

Please read the User-contributed notes policy before submitting a comment.