Skip to content

Instantly share code, notes, and snippets.

View CristhianBoujon's full-sized avatar

Cristhian Boujon CristhianBoujon

View GitHub Profile
@CristhianBoujon
CristhianBoujon / data_cotizacion.csv
Last active July 28, 2017 22:45
Gráfico de series de tiempo de la cotización del dolar en Argentina utilizando R. Las cotizaciones del dolar fueron extraídas de http://www.bcra.gov.ar/PublicacionesEstadisticas/Principales_variables_datos.asp?descri=20&fecha=Fecha_Ref&campo=Tip_Camb_Ref
View data_cotizacion.csv
FECHA VALOR
2017-05-30 16.0658
2017-05-29 16.0075
2017-05-26 16.0383
2017-05-24 16.0975
2017-05-23 16.0967
2017-05-22 16.07
2017-05-19 15.8858
2017-05-18 15.9108
2017-05-17 15.6248
@CristhianBoujon
CristhianBoujon / dollar_rate.r
Last active July 28, 2017 23:10
Plot Time serie from CSV in four lines with R
View dollar_rate.r
library(xts)
dollar_rate <- read.csv("dollar_rate.csv", colClasses = c("Date", NA))
dollar_rate_ts <- xts(dollar_rate$VALUE, order.by = dollar_rate$DATE)
plot(dollar_rate_ts, main = "Dollar Rate", xlab = "Date", ylab = "$")
@CristhianBoujon
CristhianBoujon / gist:ffbb5c2ac7f861c8a65244398b11ff02
Created May 8, 2017 20:25 — forked from matoakley/gist:1092571
MySQL to convert a string into a slug
View gist:ffbb5c2ac7f861c8a65244398b11ff02
LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name`
View cars_for_sell.txt
2017 GMC Sierra 1500
2010 Toyota Sienna
2016 Volkswagen Beetle
2011 Dodge Ram
2003 Land-Rover Range Rover
2004 Nissan Frontier
2007 Saturn Aura
2001 Ford Ranger
2012 Mercedes-Benz E
2003 Ford F-250
View cars_for_sell.py
cars_for_sell = [line.replace("\n", "") for line in open("cars_for_sell.txt")]
common_words = get_top_n_words(cars_for_sell, 20)
for word, freq in common_words:
print(word, freq)
View ts.py
import pandas as pd
import matplotlib.pyplot as plt
ads_report = pd.read_csv('ads_report.csv', parse_dates=["date"], index_col='date')
ads_report.plot()
plt.show()
View ts_2.py
import pandas as pd
import matplotlib.pyplot as plt
ads_report = pd.read_csv('ads_report_by_categories.csv', parse_dates=["date"], index_col='date')
ads_report.plot()
plt.show()
@CristhianBoujon
CristhianBoujon / python_pip.md
Last active October 5, 2018 16:21
instalar python & pip en mac
View python_pip.md

Instalar brewhome

brewhome es un gestor de paquetes

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Instalar pyenv

Pueden instalar directamente python haciendo brew install python pero les instala la última versión. Puede que esto no sea lo que queremos y brew no nos da una manera fácil de instalar versiones anteriores, así que decidí utilizar pyenv brew install pyenv

pyenv install

View simulacion.py
import tkinter as tk
import time
class Particula:
def __init__(self, x, y, radio, color='blue'):
self.circulo = canvas.create_oval(
x - radio, y - radio, x + radio, y + radio, fill=color
)
View submission.csv
posting_id matches
test_2255846744 test_2255846744 test_2255846745
test_2255846745 test_2255846745 test_2255846744
test_3588702337 test_3588702337
test_4015706929 test_4015706929