The following index is computed in Matlab:
index = find(the(:) == lat & phi(:) == lon & ~isnan(dat(:)));
All the arrays are the same size. I am trying to convert this index for use in python and add another argument as well. This is what i have so far:
index = np.argwhere((the[:] == lat) & (phi[:] == lon) & (~np.isnan(dat[:])) & (start <= tim[:] <= stop))
The idea is to use this index to find all values in arrays that fulfill the conditions in the index. When i try to use the Python version i have made, it returns the error:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I haven't gotten a.all() or a.any() to work. Do i need to use these? and if so how do i use them correctly in this case?
[:], by the way? Also, I don't think you need to useargwhere()here.