(a)
| 1641 | |
| 1642 | |
| 1643 | def _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 | |
| 1660 | def _custom_nanquantile( |
no test coverage detected
searching dependent graphs…