bundles / numpy 2.4.3 / numpy / tril_indices_from
_ArrayFunctionDispatcher
numpy:tril_indices_from
Signature
def tril_indices_from ( arr , k = 0 ) Summary
Return the indices for the lower-triangle of arr.
Extended Summary
See tril_indices for full details.
Parameters
arr: array_likeThe indices will be valid for square arrays whose dimensions are the same as arr.
k: int, optionalDiagonal offset (see tril for details).
Examples
import numpy as np
✓a = np.arange(16).reshape(4, 4) a✓
trili = np.tril_indices_from(a) trili✓
a[trili]
✓np.tril_indices(a.shape[0])
✓trili1 = np.tril_indices_from(a, k=1) a[trili1]✓
See also
- tril
- tril_indices
- triu_indices_from
Aliases
-
numpy.tril_indices_from