Created
June 26, 2018 14:33
-
-
Save tonyskapunk/0477e913b5ca62f8ab91f2ea242ae4fb to your computer and use it in GitHub Desktop.
kamorz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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