numpy.mask_indices()
numpy.mask_indices
-
numpy.mask_indices(n, mask_func, k=0)
[source] -
Return the indices to access (n, n) arrays, given a masking function.
Assume
mask_func
is a function that, for a square array a of size(n, n)
with a possible offset argumentk
, when called asmask_func(a, k)
returns a new array with zeros in certain locations (functions liketriu
ortril
do precisely this). T