Reputation: 2442
I have this 64x64 2D array
the data for this array can be downloaded here - http://m.uploadedit.com/ba3s/1494223164755.txt
Now, I wish to make a copy of this array in which the areas that have the highest value receive the value of the areas with the lowest value and vice-versa. Is there a smart way of doing it in Python?
Upvotes: 1
Views: 77
Reputation: 64318
If your data is stored in a 2dim numpy array arr
, you can do:
arr2 = arr.max() + arr.min() - arr
Upvotes: 4