Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@groupndreduce(
[
(float32, int32, float32),
(float32, int64, float32),
(float64, int32, float64),
(float64, int64, float64),
]
)
def group_nanmean(values, labels, out):
counts = np.zeros(out.shape, dtype=labels.dtype)
for indices in np.ndindex(values.shape):
label = labels[indices]
if label < 0:
continue
value = values[indices]