klyn.math.NDArray.randint
method
public static randint(min as Int, max as Int, notnull shape as IList<Int>) as NDArray<T>
Description

Creates a NDArray with random integers in [min, max] using read-only shape dimensions.

Parameters
ParameterDescription
minLower bound (inclusive).
maxUpper bound (inclusive).
shapeShape dimensions.
Returns

A random NDArray.

Throws
  • NullException if shape is null at runtime; statically null arguments are rejected with TypeError.
Example
a = NDArray<Int>.randint(0, 5, [2, 3])
print(a)