# Applying function to entire dataframe [closed]

I'm wondering if there is a faster way to do the following code, which works fine. It needs to be applied to every row of the DataFrame df. class_dct contains a different NLTK NaiveBayes classifier for each of 9 regions.

for region in regions:
new_app=[]
for title in df.booktitle:
nlp_genre=class_dct['Classif_%s'% region].classify(features(title))
new_app.append((title,region,nlp_genre))


## closed as unclear what you're asking by alecxe, t3chb0t, Graipher, Toby Speight, PeilonrayzJun 12 '17 at 9:12

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

new_app = [(title, region, class_dct['Classif_%s'% region].classify(features(title))) for title in df.booktitle]