Skip to content

Instantly share code, notes, and snippets.

Matt Davis jiffyclub

Block or report user

Report or block jiffyclub

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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
@jiffyclub
jiffyclub / pandas_date_conversion.ipynb
Last active Jun 10, 2016
Example of doing Pandas date conversion using a converter function
View pandas_date_conversion.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiffyclub
jiffyclub / precipout.py
Last active Jun 8, 2016
Example of using Orca to download and concatenate multiple datasets from the California Department of Water Resources. More on Orca at https://udst.github.io/orca/.
View precipout.py
import sys
from datetime import datetime
import orca
from caldwr.parsers.precipout import load_precipout
# this will be replaced when calling orca.run, but it's good to
# have a placeholder here so things don't crash when evaluating
# stuff ala carte or with orca-server.
You can’t perform that action at this time.