This file contains 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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import codecs | |
import re | |
import datetime | |
import time | |
from itertools import groupby | |
import numpy as np | |
import matplotlib.pyplot as plt |
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 4 columns, instead of 3. in line 8.
This file contains 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
415727619427299328,2013-12-25 06:16:02 +0000,bomberos,INCENDIO Carreteras - Panamericanas Panamericana Sur 16.4 San Juan De Miraflores M120-3 | |
415727115305504768,2013-12-25 06:14:02 +0000,bomberos,INCENDIO Cl. Cucarda 200 CIST176-4 | |
415726862464483328,2013-12-25 06:13:02 +0000,bomberos,INCENDIO Av. Villa Hermosa (huascar) (coronel Francisco Bolognesi) (4) 000 San Juan De Lurigancho M65-1 | |
415724752737955840,2013-12-25 06:04:39 +0000,bomberos,"RT @televivape: ""@bomberos: INCENDIO Pj. Pamplona Alta Sector Ollantay Mz U3 Lt 5 San Juan De Miraflores M138-4""" | |
415724096505516032,2013-12-25 06:02:03 +0000,bomberos,INCENDIO Cl. Emilio Fernandez 693 Lima M4-5 | |
415723088089976832,2013-12-25 05:58:02 +0000,bomberos,INCENDIO Pj. Pamplona Alta Sector Ollantay Mz U3 Lt 5 San Juan De Miraflores M138-4 | |
415722083558367232,2013-12-25 05:54:03 +0000,bomberos,INCENDIO Barrio Chocoy M73-3 | |
415722082702721024,2013-12-25 05:54:02 +0000,bomberos,INCENDIO Jr. Fernandez Quiroz 000 Lima | |
415720575215370241,2013-12-25 05:48:03 +0000,bombero |
This file contains 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 re | |
import sys | |
f = open(sys.argv[1].strip(), "r") | |
lines = f.readlines() | |
f.close() | |
def clean_line(line): | |
propose = "" |
This file contains 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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import codecs | |
import re | |
import datetime | |
import time | |
from itertools import groupby | |
import numpy as np | |
import matplotlib.pyplot as plt |
This file contains 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
152516 | |
153055 | |
144205 | |
151560 | |
160848 | |
181866 | |
206610 | |
254405 |
This file contains 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
# -*- coding: utf-8 -*- | |
import prettyplotlib as ppl | |
from prettyplotlib import plt | |
import sys | |
import pymc as pm | |
import numpy as np | |
datos = np.loadtxt("datos.txt") | |
alpha = 1.0/datos.mean() | |
print alpha |
This file contains 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
library(ggplot2) | |
y <- read.csv("datos.txt", header=FALSE) | |
y <- as.vector(y[,1]) | |
x <- 2005:2012 | |
int <- lsfit(x,y)$coefficients[1] | |
slope <- lsfit(x,y)$coefficients[2] | |
p <- ggplot(,aes(x,y)) | |
p + geom_point() + geom_abline(intercept=int, slope=slope) + | |
labs(title = "Perú: Número total de delitos por año") |
This file contains 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
Loreto | 2013-10-25 | 80 | http://bit.ly/18YdMbA | |
---|---|---|---|---|
Junin | 2013-09-28 | 35 | http://bit.ly/18qqNpT | |
Curahuasi | 2013-09-18 | 50 | http://bit.ly/18qqEmx | |
Huanuco | 2013-04-18 | 17 | http://bit.ly/18qqzPL | |
Urubamba | 2013-04-15 | 100 | http://bit.ly/18qqlYX | |
Ucayali | 2013-10-05 | 15 | http://bit.ly/18qqfAm | |
Satipo | 2013-09-27 | 24 | http://bit.ly/18YeiGx |
This file contains 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
Moquegua | 24.8 | 1949 | |
---|---|---|---|
Tumbes | 28.4 | 1839 | |
Ayacucho | 56.6 | 1779 | |
Pasco | 55.8 | 1769 | |
Huancavelica | 68.5 | 1750 | |
Apurímac | 60.9 | 1725 | |
Madre de Dios | 27.1 | 1584 | |
Cusco | 38.2 | 1574 | |
Amazonas | 61.7 | 1404 | |
Tacna | 26.5 | 1399 |
This file contains 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
# -*- coding: utf-8 -*- | |
import prettyplotlib as ppl | |
import numpy as np | |
from prettyplotlib import plt | |
import csv | |
from array import array | |
""" Top 20 ranking """ | |
x = [] |
NewerOlder