Hello,
I have a.csv file with two columns. I search in one of the columns for a value approximating "K" using the following script:
Thank you,
I have a.csv file with two columns. I search in one of the columns for a value approximating "K" using the following script:
Re=np.loadtxt('./Re.CSV',delimiter=',').T def closest(lst, K): lst = np.asarray(lst) idx = (np.abs(lst - K)).argmin() return lst[idx] # Driver code lst = Re[0] K=72 print(closest(lst, K))Now, I would like to have the line number corresponding to the approximate value of K, how could I get it back? Do you have any idea?
Thank you,