deselectlist =[ 'Class', 'part_id' , 'image_file'] selectlist =[x for x in data.columns if x not in deselectlist] datatowrite = date[selectlist] datatowrite.to_csv('new.csv')