Skip to content

Instantly share code, notes, and snippets.

@jiffyclub
jiffyclub / Excel to Pandas.ipynb
Created Jul 15, 2017
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#
View Excel to Pandas.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiffyclub
jiffyclub / assert_frames_equal.ipynb
Last active Feb 27, 2019
Example of a function to compare two DataFrames independent of row/column ordering and with handling of null values.
View assert_frames_equal.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiffyclub
jiffyclub / long_string.ipynb
Created Apr 15, 2014
Example of splitting a long string over multiple lines (in an IPython Notebook). http://nbviewer.ipython.org/gist/jiffyclub/10754538
View long_string.ipynb
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 Jul 6, 2012
Examples of timing and profiling Python code using built-in tools and IPython. Requires IPython 0.13+.
View ProfileDemo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiffyclub
jiffyclub / sorted_groupby.ipynb
Last active Dec 22, 2017
Example of making a groupby generator for a pandas DataFrame when the groupby column is sorted.
View sorted_groupby.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiffyclub
jiffyclub / slash_argparse.py
Created Dec 1, 2017
Utilities for creating command line-like interfaces for Slack /slash commands.
View slash_argparse.py
"""
Utilities for creating command line-like interfaces for Slack /slash commands.
Define your parser spec using an instance of SlashParser and then pass it to parse_args
for parsing. Be sure to check the returned success flag to know whether parsing
was successful or if there was a parsing error.
"""
import argparse
import re
@jiffyclub
jiffyclub / onpypi
Last active Nov 14, 2017
Script for checking whether a name is taken on PyPI.
View onpypi
#!/usr/bin/env python
"""
This script checks whether a name is taken on PyPI.
Usage:
onpypi fakename requests
Prints:
@jiffyclub
jiffyclub / meanclip.py
Created Oct 25, 2011
Computes an iteratively sigma-clipped mean on a data set. Clipping is done about median, but mean is returned.
View meanclip.py
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 / DAG-Import-Profile.ipynb
Created Nov 18, 2016
How to profile the import of an Airflow DAG definition file
View DAG-Import-Profile.ipynb
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 Jul 29, 2016
SciPy Gender Diversity Stats
View scipy_gender_stats.md
You can’t perform that action at this time.