import pandas as pd
from pathlib import Path
import os
import json

root = ''
filepath = './labels.csv'
label_file = ''

# files = os.listdir(root)
# img_files = list(filter(lambda x: '.JPEG' in x, files))
# img_files.sort(key=lambda x:int(x[15:23]))

labels1 = pd.read_csv(filepath)
labels2 = pd.read_csv(label_file)

# with open(label_file, 'r') as f:
#     lines = f.readlines()

for i in range(len(labels1)):
    new_label = labels1.loc[i, 'label']
    labels2.loc[i, 'label'] = new_label

labels2.to_csv(label_file, index=False)

