I have 2 lists like these
x = [None,[1, 15, 175, 20],
[150, 175, 18, 20],
[150, 175, 18],
[192, 150, 177],...]
y = [None,[12, 43, 55, 231],
[243, 334, 44, 12],
[656, 145, 138],
[12, 150, 177],
[150, 177, 188],...]
Now I want to erase the x values lower than 30 and y values that correspond with the erased x values. (For example, (x,y) = (1,12) in x[1] and y[1])
In order to do that, I tried to use np.where in Numpy.
I converted the x and y lists into arrays by using np.array and got this for x
array([None, list([11]), list([12, 11]), ..., list([12, 13]),list([13, 13]), list([13, 15])], dtype=object)
Then I used np.where(a<30) and got this error
TypeError: '>' not supported between instances of 'NoneType' and 'int'
I thought the None values in the first lists were the problem so I implemented
np.where(a[1:]>30)
Then I got
TypeError: '>' not supported between instances of 'list' and 'int'
I'm a beginner and want to know what caused this errors.
See Question&Answers more detail:
os