klyn.math.NDArray.randn
method
public static randn(notnull shape as IList<UInt>) as NDArray<T>
Description

Creates a new NDArray with random floating-point numbers from a normal distribution.

Uses the Box-Muller transform with mean 0 and standard deviation 1.

Parameters
ParameterDescription
shapeThe shape of the array.
Returns

A new NDArray with random floating-point numbers from a normal distribution.

Throws
  • NullException if shape is null at runtime; statically null arguments are rejected with TypeError.
Example
a = NDArray<Double>.randn([3ul, 3ul])
print(a)