SQL and PostGIS and CARTO Builder! How to make data maps with SQL.
You can find some of the datasets listed in this lesson all on this particular landing page (for other ideas)
### STOPWORDS IN PORTUGUESE | |
## Create a unique dataset from several datasets with stopwords in Portuguese | |
# Lucas Gelape | |
# Packages | |
library(dplyr) | |
library(stringi) | |
library(readr) |
import re | |
titles = ['Deputado Federal ', 'General ', 'Ex-presidente ', 'Senadora ', 'Senador ', 'do Exército', 'Tenente-Brigadeiro'] | |
novas_linhas = [] | |
for _, row in agenda2016_limpa_final.iterrows(): | |
nova_linha = [row["oque"], row["onde"], row["ano"], row["mes"], row["dia"], row["hora"]] | |
pessoas = [re.sub('|'.join(titles),'',i.split(', ')[0]) for i in row["oque"].split('; ')] | |
for pessoa in pessoas: | |
linha_com_pessoa = nova_linha[:] # o lista[:] eh para copiar a lista | |
linha_com_pessoa.append(pessoa) | |
novas_linhas.append(linha_com_pessoa) |
import requests | |
import json | |
import pymongo | |
connection = pymongo.MongoClient("mongodb://localhost") | |
db = connection.bnmp | |
mandados_mongoDB = db.mandados | |
cabeçalho = { | |
'Host': 'www.cnj.jus.br', |
SQL and PostGIS and CARTO Builder! How to make data maps with SQL.
You can find some of the datasets listed in this lesson all on this particular landing page (for other ideas)
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] |
""" | |
Autores: | |
Tiago Henrique da Cruz Pereira | |
João Felipe de Moraes Borges | |
""" | |
import threading | |
import time | |
import os | |
from urllib.request import urlopen |
#The context of this program is a course of an hour to journalists who know nothing about programming in a lab with Python 3 only. | |
import urllib.request | |
import json | |
def analisa_detalhe(cod): | |
url = 'http://educacao.dadosabertosbr.com/api/escola/' | |
resp = urllib.request.urlopen(url+str(cod)).read() | |
resp = json.loads(resp.decode('utf-8')) | |
if int(resp['salasExistentes']) > 1: | |
print ('Salas Existentes:', resp['salasExistentes']) |
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |