I have multiple .tsv files located in a directory located in a sub-directory w/ different names (sub-directory different names)
I'm trying to read each of the .tsv files and perform this command:
df_1 = pd.read_csv("C:/Car/0NN/car.tsv", delimiter='\t', encoding="utf-8-sig")
for node1 in df_1['#node1']:
for node2 in df_1['node2']:
if node1!=node2:
df_temp = df_1.iloc[0:1,1:2]
Is there a way to modify the first line so I can loop through all files ending that are "car.tsv"? The folder "0NN" change names, but the .tsv file itself has the same name, and the main "Car" folder has the same name. Thank you
Ex:
C:/Car/0NN/car.tsv
C:/Car/1AP/car.tsv