Skip to content

Instantly share code, notes, and snippets.

View abevieiramota's full-sized avatar
🎯
Focusing

Abelardo Vieira Mota abevieiramota

🎯
Focusing
View GitHub Profile
Function<CandidatoSisu, String> FUNCTION_EXTRAI_CODIGO_INEP_OCUPADO = Functions.compose(OfertaVagasSisu.FUNCTION_EXTRAI_CODIGO_INEP, CandidatoSisu.FUNCTION_EXTRAI_OFERTA_OCUPADA);
Multimap<String, CandidatoSisu> mapCodigoInepOcupadoEmCandidatos = Multimaps.index(candidatosOcupandoNoPeriodo, FUNCTION_EXTRAI_CODIGO_INEP_OCUPADO);
enum Status {
EM_ELABORACAO {
@Override
public void executar() {
System.out.println("Em elaboração");
}
},
APROVADO,
REPROVADO;
<ul><li><h2><a href="/web/20150205074541/http://www.shelfari.com/books/35527/Enterprise-Integration-Patterns">Enterprise Integration Patterns</a></h2><h4 class="author">by <a href="/web/20150205074541/http://www.shelfari.com/authors/a772018/Bobby-Woolf/">Bobby Woolf</a>, <a href="/web/20150205074541/http://www.shelfari.com/authors/a1856004/Gregor-Hohpe/">Gregor Hohpe</a></h4></li><li><h2><a href="/web/20150205074541/http://www.shelfari.com/books/30242036/Implementing-Domain-Driven-Design">Implementing Domain-Driven Design</a></h2><h4 class="author">by <a href="/web/20150205074541/http://www.shelfari.com/authors/a1002730320/Vaughn-Vernon/">Vaughn Vernon</a></h4></li><li><h2><a href="/web/20150205074541/http://www.shelfari.com/books/953168/Pattern-Oriented-Software-Architecture-Volume-1-A-System-of-Patt">Pattern-Oriented Software Architecture, Volume 1: A System of Patterns</a></h2><h4 class="author">by <a href="/web/20150205074541/http://www.shelfari.com/authors/a18737/Frank-Buschmann/">Frank Buschma
There are at least three things that many of the IO methods must deal with: reading from URL, reading/writing to a compressed format, and different text encodings. It would be great if all io functions where these factors were relevant could use the same code (consolidated codebase) and expose the same options (uniform API).
In #14576, we consolidated the codebase but more consolidation is possible. In io.common.py, there are three functions that must be sequentially called to get a file-like object: get_filepath_or_buffer, _infer_compression, and _get_handle. This should be consolidated into a single function, which can then delegate to sub functions.
Currently, pandas supports the following io methods. First for reading:
And then for writing:
Some of these should definitely use the consilidated/uniform API, such as read_csv, read_html, read_pickle, read_excel.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from bs4 import BeautifulSoup
import urllib.request
page = urllib.request.urlopen("http://wewilltakeyouwithepica.blogspot.com.br/p/por-tras-das-letras.html")
html = page.read().decode("utf-8")
bs = BeautifulSoup(html, "lxml")
texto_do_site = bs.text
@abevieiramota
abevieiramota / pep20_by_example.py
Created May 18, 2017 20:32 — forked from evandrix/pep20_by_example.py
PEP 20 (The Zen of Python) by example
#!/usr/bin/env python
"""
=====================================
PEP 20 (The Zen of Python) by example
=====================================
Usage: %prog
:Author: Hunter Blanks, [email protected] / [email protected]