import os import glob import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt stq = 14.7 fai = stq/1.4 folderpath = os.getcwd() filepathes = glob.glob(folderpath + "/*.csv") df_hind = pd.read_csv(filepathes[0],header=None) df_fai1 = pd.read_csv(filepathes[1],header=None) fai_list = np.array(df_hind.iloc[0,2:]) angle_list = np.array(df_hind.iloc[1:,1]) hind_array = np.array(df_hind.iloc[1:,2:]) print(fai_list) fai_gap = [] for i in range(len(fai_list)): fai_gap.append(abs(fai-fai_list[i])) fai_index = fai_gap.index(min(fai_gap)) print(fai_index) stq_gap = [] for i in range(len(fai_list)): stq_gap.append(abs(stq-fai_list[i])) stq_index = stq_gap.index(min(stq_gap)) print(stq_index) hind_list = np.empty(0) for hind_i in hind_array: if fai_list[fai_index]