kotlin-numpy / org.jetbrains.numkt.core / sum

sum

fun <reified T : Number> KtNDArray<T>.sum(): T? (source)

Sum of array elements over a given axis.

Return
T value.

fun <T : Number> KtNDArray<T>.sum(axis: Int): KtNDArray<T> (source)

Parameters

axis - Axis or axes along which a sum is performed. If axis is negative it counts from the last to the first axis.

Return
new KtNDArray of type T. An array with the same shape as this, with the specified axis removed.