Skip to content

Instantly share code, notes, and snippets.

@jiffyclub
jiffyclub / runtests-magic.ipynb
Created November 3, 2012 02:06
A proof of concept idea for a test runner magic in IPython.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiffyclub
jiffyclub / dataframe_concatenation.ipynb
Created June 8, 2016 22:01
Examples of concatenating two dataframes. They must have the same column names.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiffyclub
jiffyclub / pandas_date_conversion.ipynb
Last active June 10, 2016 18:51
Example of doing Pandas date conversion using a converter function
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiffyclub
jiffyclub / scipy_gender_stats.md
Last active July 29, 2016 17:59
SciPy Gender Diversity Stats
@jiffyclub
jiffyclub / DAG-Import-Profile.ipynb
Created November 18, 2016 23:26
How to profile the import of an Airflow DAG definition file
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiffyclub
jiffyclub / meanclip.py
Created October 25, 2011 00:34
Computes an iteratively sigma-clipped mean on a data set. Clipping is done about median, but mean is returned.
import numpy
def meanclip(indata, clipsig=3.0, maxiter=5, converge_num=0.02, verbose=0):
"""
Computes an iteratively sigma-clipped mean on a
data set. Clipping is done about median, but mean
is returned.
.. note:: MYMEANCLIP routine from ACS library.
@jiffyclub
jiffyclub / onpypi
Last active November 14, 2017 06:20
Script for checking whether a name is taken on PyPI.
#!/usr/bin/env python
"""
This script checks whether a name is taken on PyPI.
Usage:
onpypi fakename requests
Prints:
@jiffyclub
jiffyclub / sorted_groupby.ipynb
Last active December 22, 2017 23:38
Example of making a groupby generator for a pandas DataFrame when the groupby column is sorted.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiffyclub
jiffyclub / ProfileDemo.ipynb
Created July 6, 2012 19:57
Examples of timing and profiling Python code using built-in tools and IPython. Requires IPython 0.13+.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiffyclub
jiffyclub / Excel to Pandas.ipynb
Created July 15, 2017 05:08
Using pandas and xlrd to concatenate multiple excel sheets into a single dataframe. In answer to this Stack Overflow question: https://stackoverflow.com/questions/45113070/how-do-i-make-this-function-for-concatenating-excel-sheets-from-a-single-file-mo#
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.