I want to filter the second index of numpy array, but why can't I save it to filter_arr = []
the code :
import numpy as np
data = [
[0.0,52.0,33.0,44.0,51.0],
[0.0,30.0,45.0,12.0,44.0],
[0.0,67.0,99.0,23.0,78.0]
]
arr = np.array(data)
filter_arr = []
for i in range(0,len(arr)):
if arr[:1,i] > 50:
filter_arr.append(arr)
filter_arr = np.array(filter_arr)
filter_arr
the filter array should be :
array([[[ 0., 52., 33., 44., 51.],
[ 0., 67., 99., 23., 78.]],