Skip to content

Instantly share code, notes, and snippets.

View gfelitti's full-sized avatar

Guilherme Felitti gfelitti

  • São Paulo
View GitHub Profile
@ledmaster
ledmaster / MultipleTimeSeriesForecasting.ipynb
Last active September 24, 2024 15:14
How To Predict Multiple Time Series With Scikit-Learn (With a Sales Forecasting Example)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fmasanori
fmasanori / Raspa_salarios_UFRJ.py
Last active July 12, 2018 20:40
Raspa 15 mil vencimentos da UFRJ e mostra os maiores
import requests
from bs4 import BeautifulSoup as bs
u = 'http://www.portaldatransparencia.gov.br/servidores/OrgaoLotacao-ListaServidores.asp?CodOS=15000&DescOS=MINISTERIO%20DA%20EDUCACAO&CodOrg=26245&DescOrg=UNIVERSIDADE%20FEDERAL%20DO%20RIO%20DE%20JANEIRO&Pagina='
base = 'http://www.portaldatransparencia.gov.br/'
def extrai_valor(u):
j = u.find('=') + 1
k = u.find('&', j)
id_servidor = u[j: k]
@fmasanori
fmasanori / super salários USP.py
Created July 4, 2017 23:27
Super Salários USP
"""
Autores:
Tiago Henrique da Cruz Pereira
João Felipe de Moraes Borges
"""
import threading
import time
import os
from urllib.request import urlopen
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('ggplot') # make plots look better
#### import the data ####
df = pd.read_csv("iris.csv")
@fmasanori
fmasanori / juizes_que_mais_atuaram.py
Last active July 10, 2017 02:26
Juizes que mais atuaram segundo o site da CBF
from pdfminer.pdfinterp import PDFResourceManager, process_pdf
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from io import StringIO
from io import open
from urllib.request import urlopen
from bs4 import BeautifulSoup
import csv
@persiyanov
persiyanov / howto.md
Last active October 21, 2021 15:35
How-to get Amazon EC2 instance and do machine learning on it. Jupyter 4.0.6 server and Python 2.7.

Goal

Want to move computation on machine with much power. We will set up Anaconda 4.0.0 and XGBoost 0.4 (it is tricky installable).

Preliminaries

Let's start

AWS Console and launching EC2 Instance.

@ozen
ozen / Selenium PhantomJS Python Header.py
Last active November 14, 2024 05:29
How to set request headers when using Selenium Python with PhantomJS driver
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
desired_capabilities = DesiredCapabilities.PHANTOMJS.copy()
desired_capabilities['phantomjs.page.customHeaders.User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) ' \
'AppleWebKit/537.36 (KHTML, like Gecko) ' \
'Chrome/39.0.2171.95 Safari/537.36'
driver = webdriver.PhantomJS(desired_capabilities=desired_capabilities)
@jdye64
jdye64 / gist:ca07e01ff3d8e93210c3
Created June 23, 2015 03:59
Convert .dav files in current directory to .mp4
#!/usr/bin/python
print "Converting all of the .dav files in this current directory into .mp4 files using ffmpeg"
import os
from subprocess import call
files = [f for f in os.listdir('.') if os.path.isfile(f)]
for f in files:
ext = f.split(".")[-1]
if ext == "dav" or ext == "DAV":
@guy-a
guy-a / leacher.py
Created May 3, 2015 22:22
A python script for leeching a folder on an FTP. run$ python supervisor.py leacher.py
import os
import logging
import ftplib
from ftplib import FTP
class Leacher:
def __init__(self, host, account, passwd, ftp_folder='', local_folder_path='', delete_files='False', file_match=''):
logging.basicConfig(filename='leacher.log', format='%(asctime)s - %(levelname)s: %(message)s', level=logging.DEBUG)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.