Skip to content
New issue

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

Using a non-tuple sequence for multidimensional indexing #9

Open
ShantanuKodgirwar opened this issue Feb 2, 2022 · 0 comments
Open

Comments

@ShantanuKodgirwar
Copy link

Multidimensional indexing must use tuple after using the slice command when indexing, arr[tuple(seq)] instead of arr[seq].

In the package for example under csb.numeric.pad:
slices = [slice(s[i], -s[i]) for i in range(len(s))]
y[slices] = x

Instead of y[slices], it should be y[tuple(slices)]

Currently it throws a future warning as:
FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant