I want to create a new dataframe having only those rows which has name in the Image_list. Original df has records more than 200,000 whereas Image_list has only 300 list of image names.
for name in Image_list:
df1= df.loc[df['ID']== name]
print(df1)
Final_data.append(df1)
Final_data.shape
'ID' column contains much more than Image_list, for example
['Black_Hair',
'Eyeglasses',
'Male',
'Smiling',
'Straight_Hair',
'Wearing_Earrings',
'Wearing_Necktie']
df1= df[df['ID']==name]Final_data = Final_data.append(df1)pd.concat()instead ofdf.append(), see my answer