I'm porting a program from to and I need help with indexing.

The best way I've found so far is to use negative indexes with NumPy while switching X and Y dimensions. It feels really hackish and looks ugly, tho. Is there a better way?

Follow

With examples:

Dimension order
M: (y, x, z, t)
N: (t, z, y, x)

Indexing
a(1) => a[-2]
a(2) => a[-1]
a(3) => a[-3]
a(4) => a[-4]

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!