Is there a way to “enumerate” mapslices other than
i = 0
result = mapslices(myarray; dims=dims) do x
i += 1
myfunction(x, i)
end
?
Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the appropriate answer back to Slack, or pinging the poster here on Discourse so they can follow this thread. (Original message )(More Info)
(I’m the OP) I’m aware of eachslice but unfortunately I’m deliberately avoiding it, because dims in eachslice has the opposite meaning to that in mapslices (e.g. dims=1 <=> dims=2), and I want to follow the mapslices convention for other reasons.