MCPcopy
hub / github.com/dask/dask / _span_indexers

Function _span_indexers

dask/array/reductions.py:1643–1657  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

1641
1642
1643def _span_indexers(a):
1644 # We have to create an indexer so that we can index into every quantile slice
1645 # The method relies on the quantile axis being the last axis, which means that
1646 # we have to calculate reduce(mul, list(a.shape)[:-1]) number of quantiles
1647 # We create an indexer combination for each of these quantiles
1648
1649 shapes = 1 if len(a.shape) <= 2 else reduce(mul, list(a.shape)[1:-1])
1650 original_shapes = shapes * a.shape[0]
1651 indexers = [tuple(np.repeat(np.arange(a.shape[0]), shapes))]
1652
1653 for i in range(1, len(a.shape) - 1):
1654 indexer = np.repeat(np.arange(a.shape[i]), shapes // a.shape[i])
1655 indexers.append(tuple(np.tile(indexer, original_shapes // shapes)))
1656 shapes //= a.shape[i]
1657 return indexers
1658
1659
1660def _custom_nanquantile(

Callers 1

_custom_nanquantileFunction · 0.85

Calls 2

repeatMethod · 0.80
arangeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…