I got one 2-D array
data = [[1,2,3...], [4,5,6...], [7,8,9...], ...]
and another 1-D array which contains the MINIMUM value of each sub-array from above:
minima= [1, 4, 7, ....]
. So consequently len(minima) = len(data)
.
Now i want to set a threshold value, say threshold = 7
and want to delete each sub-array of data
with a minimum below this threshold. So I tried the following:
threshold = 7
for i in range(len(minima)):
if minima[i] < threshold:
data = np.delete(data, i, 1)
but this gives me an IndexError: IndexError: index 225 is out of bounds for axis 1 with size 225
I guess it has sth to do with the axis and a loop is not the best approach but my expertise is very limited. Appreciate your help!