klyn.math.NDArray.NDArray
constructor
public NDArray(notnull values as IList<IList<T>>)
Description

Copies rectangular rows into a new 2D NDArray, including empty rows. Rows and columns determine the shape, in row-major order.

Parameters
ParameterDescription
valuesSource rows, copied independently of their lists.
Throws
  • ValueException if a row is null or row lengths differ.
  • NullException if values is null at runtime; statically null arguments are rejected with TypeError.
Example
a = NDArray<Int>([[1, 2], [3, 4]])
print(a.shape)  # [2, 2]
print(a[1, 0])  # 3