Skip to content

Instantly share code, notes, and snippets.

import numpy as np
import pandas as pd
import itertools as it
import matplotlib.pyplot as plt
import logging
log_fmt = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logging.basicConfig(level=logging.INFO, format=log_fmt)'BEGIN')
gpfreitas /
Created Jun 3, 2018 — forked from kwmiebach/
pytest cheat sheet


(Remember to create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...


This script takes as input a list of Python source files and outputs the
top-level modules that are imported in those source files.
The script does this without executing any code. This is useful when you have
exercise code (that often has syntax errors / missing code) or if you want to
avoid any harmful side-effects of executing untrusted code.
gpfreitas / unix_ref.rst
Created Nov 28, 2015
Resources for someone who wants to learn to use UNIX-like systems from the command-line, with some focus on data analysis
View unix_ref.rst
gpfreitas / hist.awk
Last active Nov 24, 2015
Histogram for integer x and y values
View hist.awk
# hist.awk - Histogram for integer x and y values
# This AWK program takes as input a sequence of x, y integer values, one per
# row, where x is supposed to be the bin, and y is the count of values in that
# bin. In other words, this sequence already encodes the histogram (think of
# the output of uniq -c), so this script only pretty prints that histogram to
# the screen. Furthermore, we assume that the input rows are sorted by the bin
# values (the first column) and that the counts in the second column are always
# nonnegative.
gpfreitas /
Last active Aug 29, 2015
Test operations with NULL, NaN and Infinity in Pig
#!/usr/bin/env sh
USAGE='NAME -- Test operations with NULL, NaN and Infinity