Skip to content

enumerate() like equivalents for iterating over columns/rows of a matrix #14491

@AzamatB

Description

@AzamatB

It would be good to be able to iterate over columns (rows) as follows:

for col in columns(A)
    # some code
end

This can be part of a more generic interface slices(A, dims), with rows(A) and columns(A) being alias for slices(A, 1) and slices(A, 2) respectively.

With this we can consider deprecating mapslices(f, A; dims) in favor of map(f, slices(A, dims))

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]speculativeWhether the change will be implemented is speculative

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions