Reputation: 1300
I am using python and munpy. I have 2 dimesional object mask. It is graphic mak with integer coordinates and value.I want to use part of matrix like:
mask[:100,300:]
Is it possible to create variable like range = (:100,300:) and to use like:
mask[range]
or similar approach
Upvotes: 0
Views: 42
Reputation: 50899
You can use the built-in slice
ranges = slice(0, 100), slice(300, None)
mask[ranges]
Upvotes: 2