package np

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tag = [
  1. | `ISeedSequence
]
type t = [ `ISeedSequence | `Object ] Obj.t
val of_pyobject : Py.Object.t -> t
val to_pyobject : [> tag ] Obj.t -> Py.Object.t
val generate_state : ?dtype:Py.Object.t -> n_words:int -> [> tag ] Obj.t -> Py.Object.t

generate_state(n_words, dtype=np.uint32)

Return the requested number of words for PRNG seeding.

A BitGenerator should call this method in its constructor with an appropriate `n_words` parameter to properly seed itself.

Parameters ---------- n_words : int dtype : np.uint32 or np.uint64, optional The size of each word. This should only be either `uint32` or `uint64`. Strings (`'uint32'`, `'uint64'`) are fine. Note that requesting `uint64` will draw twice as many bits as `uint32` for the same `n_words`. This is a convenience for `BitGenerator`s that express their states as `uint64` arrays.

Returns ------- state : uint32 or uint64 array, shape=(n_words,)

val to_string : t -> string

Print the object to a human-readable representation.

val show : t -> string

Print the object to a human-readable representation.

val pp : Format.formatter -> t -> unit

Pretty-print the object to a formatter.

OCaml

Innovation. Community. Security.