groupNDArrayBy

inline fun <T, D : Dimension, K> MultiArray<T, D>.groupNDArrayBy(keySelector: (T) -> K): Map<K, NDArray<T, D1>>

Groups elements of a given ndarray by the key returned by keySelector for each element, and returns a map where each group key is associated with an ndarray of matching elements.


inline fun <T, D : Dimension, K, V : Number> MultiArray<T, D>.groupNDArrayBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, NDArray<V, D1>>

Groups values returned by valueTransform applied to each element of the given ndarray with the key returned by keySelector applied to each element, and returns a map where each group key is associated with an ndarray of matching values.