Skip to content

Using a non-tuple sequence for multidimensional indexing #9

@ShantanuKodgirwar

Description

@ShantanuKodgirwar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions