Applying function to entire dataframe 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))
I guess the Python interpreter will optimise most or all of this on its own, but you could try a list comprehension and removing an intermediate variable:

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