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
| # galería de gráficos: gasolinas (heatmap+violines) + ipsa + other good ones | |
| import seaborn as sns | |
| import pandas as pd | |
| #1 IPSA: | |
| #2 CNE | |
| #3 |
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 boto3 | |
| import os, sys | |
| s3 = boto3.resource('s3') | |
| def down(canal,token): | |
| x = os.popen(f'lss3 matinales/audio/{canal}/|find "{token}"').read() | |
| files=[f for f in x.split() if 'mp3' in f] | |
| print(files) | |
| for f in files: |
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
| # https://gis.stackexchange.com/questions/113799/how-to-read-a-shapefile-in-python | |
| # http://geospatialpython.com/2011/09/reading-shapefiles-from-cloud.html | |
| # https://medium.com/@loldja/reading-shapefile-zips-from-a-url-in-python-3-93ea8d727856 | |
| # http://andrewgaidus.com/Reading_Zipped_Shapefiles/ | |
| # https://gis.stackexchange.com/questions/113799/how-to-read-a-shapefile-in-python | |
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, requests, time | |
| import sqlite3, pandas as pd | |
| from bs4 import BeautifulSoup | |
| STATIC_FOLDER = os.getenv('STATIC_FOLDER') | |
| CANALES = ['rec-tv','canal-13-c','mega','canal-13','tvn','chilevision','ucv-tv', | |
| 'tnt','la-red','fox','tnt','hbo','sony','axn','warner','a-e-mundo', | |
| 'universal-channel','space','fx'] | |
| # 'tvn-24h' |
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 pandas as pd | |
| from geopandas import GeoDataFrame | |
| from shapely.geometry import Point | |
| import fiona | |
| df = pd.read_csv('data.csv') | |
| geometry = [Point(xy) for xy in zip(df.x, df.y)] | |
| crs = {'init': 'epsg:2263'} #http://www.spatialreference.org/ref/epsg/2263/ | |
| geo_df = GeoDataFrame(df, crs=crs, geometry=geometry) |
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) |
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
| { | |
| "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
| 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): |