So I found the lowest value in my array using val = np.argmin(R_abs)
in line 50, but now I'm trying to find the index of that value. I tried using val_index = [idx for idx, minval in enumerate(R_abs) if minval == val]
in line 52, but I get an empty array. What am I doing wrong? I believe .list() only works for list. R_abs is an array.
R_abs = abs(R-atm_tropo)
val = np.argmin(R_abs) # (line 50)
# val_index = np.where(R_abs == val)
val_index = [idx for idx, minval in enumerate(R_abs) if minval == val] # (line 52)
Updated for NumPy Array instead of Python List:
This article suggests that you use
np.where
:Returns