Skip to content

Instantly share code, notes, and snippets.

View dash_simple_example_pandas_datareader.py
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
from pandas_datareader import data as web
from datetime import datetime as dt
app = dash.Dash('Hello World')
View dash_crossfilter_example.py
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd
app = dash.Dash()
df = pd.read_csv(
'https://gist.githubusercontent.com/chriddyp/'
@gachet
gachet / producer_consumer.py
Last active December 10, 2019 21:27 — forked from cristipufu/producer_consumer.py
Producer-consumer problem in python
View producer_consumer.py
import sys
import random
import time
from threading import *
class Producer(Thread):
def __init__(self, items, can_produce, can_consume):
Thread.__init__(self)
self.items = items
self.can_produce = can_produce
@gachet
gachet / Assignment2 (1).ipynb
Created November 21, 2018 12:42 — forked from GeorgyGol/Assignment2 (1).ipynb
Assignment 2 for Week 2 of Applied Plotting, Charting and Data Representation in Python Coursera course
View Assignment2 (1).ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View test_pyspark.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gachet
gachet / Ubidots_PubSubClient_Example.ino
Created March 3, 2018 15:02 — forked from jotathebest/Ubidots_PubSubClient_Example.ino
This script is a basic example for sending data to Ubidots using the PubSubClient library. It is useful for developers that want to make their own libraries to connect their devices.
View Ubidots_PubSubClient_Example.ino
/****************************************
* Include Libraries
****************************************/
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <stdio.h>
@gachet
gachet / annoytutorial-text8.ipynb
Created September 11, 2017 10:00 — forked from pmbaumgartner/annoytutorial-text8.ipynb
Annoy Tutorial - Text8 Changes
View annoytutorial-text8.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gachet
gachet / gensim_word2vec_demo.py
Created June 13, 2017 10:52 — forked from bhaettasch/gensim_word2vec_demo.py
Use gensim to load a word2vec model pretrained on google news and perform some simple actions with the word vectors.
View gensim_word2vec_demo.py
from gensim.models import Word2Vec
# Load pretrained model (since intermediate data is not included, the model cannot be refined with additional data)
model = Word2Vec.load_word2vec_format('GoogleNews-vectors-negative300.bin', binary=True, norm_only=True)
dog = model['dog']
print(dog.shape)
print(dog[:10])
# Deal with an out of dictionary word: Михаил (Michail)
@gachet
gachet / word2vec_tweets_preprocessor.py
Created June 13, 2017 10:45 — forked from ravyg/word2vec_tweets_preprocessor.py
Clean tweets json for tensorflow or gensim based word2vec plain text
View word2vec_tweets_preprocessor.py
# -*- coding: utf-8 -*-
import json
import re
import os
import nltk
input_file = open('<JSON FILE To INPUT>','r').readlines()
for line in input_file:
try:
tweet = json.loads(line)