import os
import pandas as pd
l_nor = os.listdir(train_nor_dir)
l_nor_label = [0 for i in l_nor]
l_pne = os.listdir(train_pne_dir)
l_pne_label = [1 for i in l_pne]
l_img = l_nor + l_pne
l_label = l_nor_label + l_pne_label
data = {"img": l_img, "l_label": l_label}
data_df = pd.DataFrame(data)
data_df.values
array([['NORMAL2-IM-0771-0001.jpeg', 0],
['NORMAL2-IM-1294-0001-0002.jpeg', 0],
['IM-0675-0001.jpeg', 0],
...,
['person931_virus_1592.jpeg', 1],
['person861_virus_1506.jpeg', 1],
['person1051_bacteria_2985.jpeg', 1]], dtype=object)