This file contains hidden or 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
| import spotipy | |
| import spotipy.util as util | |
| from creds import CLIENT_ID, CLIENT_SECRET | |
| token = util.prompt_for_user_token(username = 'sergiolucero', scope='', | |
| client_id=CLIENT_ID, | |
| client_secret=CLIENT_SECRET, | |
| redirect_uri='http://quant.cl/what' | |
| ) |
This file contains hidden or 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
| import plotly.graph_objs as go | |
| from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot | |
| from IPython.display import HTML | |
| trace = go.Sunburst( | |
| labels=["Carlina", "Alejandro", "Sylvia", "Daniel", "Ingrid", "Juan", "Caty", "Sergio", "Laura", "Miguel"], | |
| parents=["", "Carlina", "Carlina", "Sylvia", "Sylvia", "Carlina", "Carlina", "Caty", "Carlina", "Carlina"], | |
| values=[10, 14, 12, 10, 2, 6, 6, 4, 4, 6], | |
| outsidetextfont = {"size": 20, "color": "#377eb8"}, marker = {"line": {"width": 2}}, | |
| ) |
This file contains hidden or 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
| from pptx import Presentation | |
| from pptx.util import Inches | |
| import glob | |
| SLIDE_LAYOUT_TITLE_AND_CONTENT = 1 | |
| FILTER = 'fotos/*.jpg' # what to include | |
| prs = Presentation() | |
| slide_layout = prs.slide_layouts[SLIDE_LAYOUT_TITLE_AND_CONTENT] |
This file contains hidden or 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
| from math import atan | |
| import folium, pandas as pd | |
| viajes = pd.read_html('http://quant.cl/blc_read')[0] | |
| fm = folium.Map(location=[-33.41,-70.59], zoom_start=14, | |
| width=1000, height=400, tiles='stamenwatercolor') | |
| for idx, row in viajes.iterrows(): | |
| fromloc, toloc = eval(row['fromloc']), eval(row['toloc']) # viene como "string" |
This file contains hidden or 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
| import requests, pandas as pd | |
| from bs4 import BeautifulSoup | |
| pd.set_option('max_colwidth',-1) | |
| base_url = 'https://www.cntv.cl/cntv/site/tax/port/all/taxport_16___1.html' | |
| bs = BeautifulSoup(requests.get(base_url).text, 'lxml') | |
| top = pd.DataFrame() | |
| links = [link for link in bs.find_all('a') if 'más' in link.text] | |
| print(f'{len(links)} meses de denuncias') |
This file contains hidden or 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
| import requests, pandas as pd | |
| from bs4 import BeautifulSoup | |
| CLIO_DEF = 'https://www.yapo.cl/chile/inmuebles?ca=15_s&l=0&q=casa&cmn=&st=a' | |
| def text_search(bs, classname): | |
| return [p0.text.strip() | |
| for p0 in bs.find_all('span', attrs={'class': classname})] | |
| def scrape_yapo(url = CLIO_DEF): |
This file contains hidden or 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
| import requests, pandas as pd | |
| from bs4 import BeautifulSoup | |
| CLIO_DEF = 'https://www.yapo.cl/chile/inmuebles?ca=15_s&l=0&q=casa&cmn=&st=a' | |
| def text_search(bs, classname): | |
| return [p0.text.strip() | |
| for p0 in bs.find_all('span', attrs={'class': classname})] | |
| def scrape_yapo(url = CLIO_DEF): |
This file contains hidden or 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
| { | |
| "nodes": [ | |
| { | |
| "id": "DAG INGENIERIA Y CONSTRU", | |
| "group": 0 | |
| }, | |
| { | |
| "id": "ALBEMARLE LIMITADA (ROCK", | |
| "group": 1 | |
| }, |
This file contains hidden or 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
| from flask import Flask | |
| from flask_sqlalchemy import SQLAlchemy | |
| import os | |
| import graphene | |
| from graphene_sqlalchemy import SQLAlchemyObjectType, SQLAlchemyConnectionField | |
| from flask_graphql import GraphQLView | |
| ################################# | |
| app = Flask(__name__) | |
| app.debug = True |
This file contains hidden or 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
| import os, time | |
| from pprint import pprint | |
| from collections import defaultdict | |
| from win32com.client import Dispatch | |
| t0 = time.time() | |
| outlook=Dispatch("Outlook.Application").GetNamespace("MAPI") | |
| #inbox = outlook.GetDefaultFolder("6") | |
| confi = outlook.Folders(2).Folders(2) # found by trial and error | |
| counts = defaultdict(int) |