layout | title | description | tags | ||
---|---|---|---|---|---|
default |
SQL Style Guide |
A guide to writing clean, clear, and consistent SQL. |
|
I want to do ETL and I want to do it in python. What tools do I have access to?
-
Orca is a lightweight pandas centric library for building simple data pipelines
-
Luigi - seems to be for very heavy weight projects
-
Airflow from Airbnb - not used this yet
-
night-shift - lightweight data flow.
This file contains hidden or 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
-- These queries let you define find user sessions against event data | |
-- logged to Segment SQL, Snowplow, or Google BigQuery. | |
-- For more details, see the full post: | |
-- LINK | |
--- SEGMENT SQL | |
-- Finding the start of every session | |
SELECT * | |
FROM ( |
Working on a DSL for the elastic package. Get latest, install from dsl
branch
install.packages("devtools")
devtools::install_github("ropensci/elastic", ref="dsl")
This file contains hidden or 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
Overview of National Security StrategyAt the dawn of the 21st century, the United States of America faces a broad and complex array of chal-lenges to our national security. Just as America helped to determine the course of the 20th century, we must now build the sources of American strength and influence, and shape an international order capable of overcoming the challenges of the 21st century. | |
The World as It Is, A Strategy for the World We Seek To succeed, we must face the world as it is. The two decades since the end of the Cold War have been marked by both the promise and perils of change. The circle of peaceful democracies has expanded; the specter of nuclear war has lifted; major powers are at peace; the global economy has grown; commerce has stitched the fate of nations together; and more individuals can determine their own destiny. Yet these advances have been accompanied by persistent problems. Wars over ideology have given way to wars over religious, ethnic, and tribal identity; nuclear dangers hav |
This file contains hidden or 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
""" | |
NMF by coordinate descent, designed for sparse data (without missing values) | |
""" | |
# Author: Mathieu Blondel <[email protected]> | |
# License: BSD 3 clause | |
import numpy as np | |
import scipy.sparse as sp | |
import numba |
This file contains hidden or 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 sys | |
import logging | |
import psycopg2 | |
import pandas as pd | |
import pandas.io.sql as sqlio | |
import ConfigParser | |
import argparse | |
import statistics | |
from pandas import pivot_table, crosstab | |
from datetime import datetime |
This file contains hidden or 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
""" | |
A deep neural network with or w/o dropout in one file. | |
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/ | |
""" | |
import numpy, theano, sys, math | |
from theano import tensor as T | |
from theano import shared | |
from theano.tensor.shared_randomstreams import RandomStreams |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
This file contains hidden or 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 python2.7 | |
# -*- coding: utf-8 -*- | |
"""An example of A/B test using the chi-squared test for independence.""" | |
import numpy as np | |
import pandas as pd | |
from scipy.stats import chi2_contingency | |
def main(): | |
data = pd.io.parsers.read_csv('n10000.csv') |