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