For a 2D numpy array, i.e.
import numpy as np data = np.array([ [11,12,13], [21,22,23], [31,32,33], [41,42,43], ])
I need to both create a new subrange and change the selected elements in place based on two mask vectors for the required rows and columns;
rows = [False, False, True, True] cols = [True, True, False]
Thus,
print subArray
Marcus jones
source share