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