Skip to content

Instantly share code, notes, and snippets.

@abhishek-shrm
Last active September 22, 2020 13:54
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 abhishek-shrm/cd28e8367879db5c1a1393dcda5d7ae1 to your computer and use it in GitHub Desktop.
Save abhishek-shrm/cd28e8367879db5c1a1393dcda5d7ae1 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
comment_word_count = []
# Populate the lists with length of comments
for i in df_train['cleaned']:
comment_word_count.append(len(i.split()))
# Create a dataframe with length of comments
length_df = pd.DataFrame({'Comment Length':comment_word_count})
# Plotting the histogram
length_df.hist(bins = 100, range=(0,500),figsize=(12,8))
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment