Skip to content

Instantly share code, notes, and snippets.

View CristhianBoujon's full-sized avatar

Cristhian Boujon CristhianBoujon

View GitHub Profile
posting_id matches
test_2255846744 test_2255846744 test_2255846745
test_2255846745 test_2255846745 test_2255846744
test_3588702337 test_3588702337
test_4015706929 test_4015706929
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
)
@CristhianBoujon
CristhianBoujon / python_pip.md
Last active October 5, 2018 16:21
instalar python & pip en mac

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

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()
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()
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)
@CristhianBoujon
CristhianBoujon / get_top_n_words.py
Last active May 20, 2021 09:14
List the words in a vocabulary according to occurrence in a text corpus , Scikit-Learn
def get_top_n_words(corpus, n=None):
"""
List the top n words in a vocabulary according to occurrence in a text corpus.
get_top_n_words(["I love Python", "Python is a language programming", "Hello world", "I love the world"]) ->
[('python', 2),
('world', 2),
('love', 2),
('hello', 1),
('is', 1),
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
@CristhianBoujon
CristhianBoujon / dollar_rate.r
Last active July 28, 2017 23:10
Plot Time serie from CSV in four lines with 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 / 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
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