MCPcopy Create free account
hub / github.com/dask/dask / triu

Function triu

dask/array/routines.py:2532–2542  ·  view source on GitHub ↗
(m, k=0)

Source from the content-addressed store, hash-verified

2530
2531@derived_from(np)
2532def triu(m, k=0):
2533 m = asarray_safe(m, like=m)
2534 mask = tri(
2535 *m.shape[-2:],
2536 k=k - 1,
2537 dtype=bool,
2538 chunks=m.chunks[-2:],
2539 like=meta_from_array(m),
2540 )
2541
2542 return where(mask, np.zeros_like(m, shape=(1,)), m)
2543
2544
2545@derived_from(np)

Callers

nothing calls this directly

Calls 4

asarray_safeFunction · 0.90
triFunction · 0.90
meta_from_arrayFunction · 0.90
whereFunction · 0.70

Tested by

no test coverage detected