word count dataframe python code example Example: unique words from pandas results = set() df['text'].str.lower().str.split().apply(results.update)