Skip to content

Instantly share code, notes, and snippets.

View danielballan's full-sized avatar

Dan Allan danielballan

View GitHub Profile
@danielballan
danielballan / gmail.py
Created February 6, 2014 16:02
Gmail Parser
#!/usr/bin/python
import sys
import re
from dateutil.parser import parse
import email
import html2text
import MySQLdb
from itertools import *
@danielballan
danielballan / gist:11178744
Created April 22, 2014 13:15
Traceback for pandas SQL timedelta issue
In [27]: df.to_sql('bar', engine, index=False)
---------------------------------------------------------------------------
StatementError Traceback (most recent call last)
<ipython-input-27-7476a9ea602a> in <module>()
----> 1 df.to_sql('bar', engine, index=False)
/Users/danielallan/Documents/Repos/pandas-danielballan/pandas/core/generic.py in to_sql(self, name, con, flavor, if_exists, index, index_label)
940 sql.to_sql(
941 self, name, con, flavor=flavor, if_exists=if_exists, index=index,
--> 942 index_label=index_label)
@danielballan
danielballan / gist:b1ede9b5eb7b33cbf594
Last active August 29, 2015 14:03
Parse Zetasizer data
"""
Copyright 2014 Dan Allan
Read the data from a Zetasizer output file and return the intensity as
as a function of frequency in a spreadsheet-like object (pandas DataFrame)
that can exported to any convenient format.
This is only lightly tested.
"""
@danielballan
danielballan / gist:ba97de07fe9595df0f6f
Created July 16, 2014 13:34
Traceback of a failed conda build on Windows 64-bit. This succeeded on Windows 32-bit.
running install
running bdist_egg
running egg_info
creating PIMS.egg-info
writing PIMS.egg-info\PKG-INFO
writing top-level names to PIMS.egg-info\top_level.txt
writing dependency_links to PIMS.egg-info\dependency_links.txt
writing manifest file 'PIMS.egg-info\SOURCES.txt'
reading manifest file 'PIMS.egg-info\SOURCES.txt'
writing manifest file 'PIMS.egg-info\SOURCES.txt'
@danielballan
danielballan / gist:b88815e290ba55c1084a
Created September 17, 2014 19:32
photo-activation-nation.mplstyle
# This is Dan Allan's setting of Professor Robert Leheny's plotting style preferences.
# Updated August 2014
#
# Invoke in Python matplotlib like so:
#
# import matplotlib as mpl
#
# mpl.style.use('https://gist.github.com/danielballan/be066529de85e87a5fe7/raw')
#
# This feature is only available in matplotlib version 1.4 or higher.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.