I have matrix like this:
m1 =
[1, 3, 4, 2, 1, 1]
[1, 3, 5, 3, 3, 1]
[1, 2, 3, 1, 1, 0]
[1, 3, 7, 3, 1, 1]
I need to filter it tp get value 1 in the last column. So result should be like this:
filter_array =
[1, 3, 4, 2, 1, 1]
[1, 3, 5, 3, 3, 1]
[1, 3, 7, 3, 1, 1]
My current code is:
m1 = np.array ##see array above
filter_array = [ ] ## the filtered array will be stored here. raw by raw
for raw in m1:
if raw[-1] ==1:
filter_array = filter_array.append(raw[:])
My code gives me back an empty array. I've must missed something...