(arr, cdf)
| 4875 | cdf[cdf == 0] = -1 |
| 4876 | |
| 4877 | def find_cdf_1d(arr, cdf): |
| 4878 | indices = np.searchsorted(cdf, quantiles, side="left") |
| 4879 | # We might have reached the maximum with i = len(arr), e.g. for |
| 4880 | # quantiles = 1, and need to cut it to len(arr) - 1. |
| 4881 | indices = minimum(indices, values_count - 1) |
| 4882 | result = take(arr, indices, axis=0) |
| 4883 | return result |
| 4884 | |
| 4885 | r_shape = arr.shape[1:] |
| 4886 | if quantiles.ndim > 0: |