I am trying to remove rows with ['tempn', '0', '0'] in it. Rows with ['tempn', '0'] should not be removed however.
my_input = array([['temp1', '0', '32k'],
['temp2', '13C', '0'],
['temp3', '0', '465R'],
['temp4', '0', '0'],
['temp5', '22F', '0'],
['temp6', '0', '-15C'],
['temp7', '0', '0'],
['temp8', '212K', '1'],
['temp9', '32C', '0'],
['temp10', '0', '19F']],
dtype='|S2'), array([['temp1', '15K'],
['temp2', '0'],
['temp3', '16C'],
['temp4', '0'],
['temp5', '22F'],
['temp6', '0'],
['temp7', '457R'],
['temp8', '305K'],
['temp9', '0'],
['temp10', '0']], dtype='|S2')]
Based on a previous question, I tried
my_output = []
for c in my_input:
my_output.remove(c[np.all(c[:, 1:] == '1', axis = 1)])
I sprung up with a value error however, saying truth value of an array of more than one element is ambiguous. Thanks!