We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproduction:
>>> def test(n): ... inds = np.zeros((n, 5), dtype=np.intp) ... return np.ravel_multi_index(inds, (1,)*n) >>> test(2) array([0, 0, 0, 0, 0], dtype=int64) >>> test(1) array([0, 0, 0, 0, 0], dtype=int64) >>> test(0) ValueError: At least one iterator operand must be non-NULL
The expected result is array([0, 0, 0, 0, 0], dtype=int64) for all cases.
array([0, 0, 0, 0, 0], dtype=int64)
Relates to gh-13934.
The text was updated successfully, but these errors were encountered:
Hmm, I think I've seen this before (edit: gh-580). The issue is that the signature of ravel_multi_index is really:
ravel_multi_index
ravel_multi_index(multi_index: Sequence[np.ndarray], shape: tuple)
and not
ravel_multi_index(multi_index: np.ndarray, shape: tuple)
As a result, ravel_multi_index has no shape information available.
This is the reverse of the arr_0d.nonzero() problem.
arr_0d.nonzero()
Sorry, something went wrong.
FWIW, this has the same problem:
def test(n): inds = np.zeros(5, dtype=np.intp) return np.ravel_multi_index((inds,) * n, (1,)*n)
ValueError: At least one iterator operand must be non-NULL
I had to put in a workaround for this recently, so let me know if you start working on a solution.
No branches or pull requests
Reproduction:
The expected result is
array([0, 0, 0, 0, 0], dtype=int64)
for all cases.Relates to gh-13934.
The text was updated successfully, but these errors were encountered: