Skip to content

Instantly share code, notes, and snippets.

@tonyskapunk
Created June 26, 2018 14:33
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 tonyskapunk/0477e913b5ca62f8ab91f2ea242ae4fb to your computer and use it in GitHub Desktop.
Save tonyskapunk/0477e913b5ca62f8ab91f2ea242ae4fb to your computer and use it in GitHub Desktop.
kamorz
#!/usr/bin/python
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from newspaper import Article
mechon_url = 'https://www.azlyrics.com/lyrics/bandams/elmechon.html'
article = Article(mechon_url)
article.download()
article.parse()
letra = article.text.replace('\n', ' ')
s = pd.Series(letra.split())
d = s.value_counts().head(10).plot.bar()
fig = d.get_figure()
fig.savefig('./psicobanda.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment