Skip to content

Instantly share code, notes, and snippets.

@aravindpai
Created May 27, 2019 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aravindpai/b43849b7efe2cc0bc1a73879d9452b0b to your computer and use it in GitHub Desktop.
Save aravindpai/b43849b7efe2cc0bc1a73879d9452b0b to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
text_word_count = []
summary_word_count = []
# populate the lists with sentence lengths
for i in data['cleaned_text']:
     text_word_count.append(len(i.split()))
for i in data['cleaned_summary']:
     summary_word_count.append(len(i.split()))
length_df = pd.DataFrame({'text':text_word_count, 'summary':summary_word_count})
length_df.hist(bins = 30)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment