I wanna Search how many times "bad" and "good" words are repeated in the data frame and visualize this with histogram.
Jurgy's answer should work. However, based on comments above, you can simply do like this,
Otherwise, if you want to use
seaborn library and create a plot follow this.
Without any knowledge how you would define 'good' or 'bad' this would be the general approach:
def count_good(text): # TODO: how do you define good? pass def count_bad(text): # TODO: how do you define bad? pass def analyze(df) good_count = df.words.apply(count_good).sum() bad_count = df.words.apply(count_bad).sum() plt.bar([0, 1], [good_count, bad_count]) plt.xticks([0, 1], ['Good', 'Bad']) plt.show()
But you really need to improve your question if you want a serious answer.