Skip to content

Instantly share code, notes, and snippets.

Avatar

Dan Allan danielballan

View GitHub Profile
View gmail.py
#!/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 Apr 22, 2014
Traceback for pandas SQL timedelta issue
View gist:11178744
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)
View gist:b1ede9b5eb7b33cbf594
"""
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 Jul 16, 2014
Traceback of a failed conda build on Windows 64-bit. This succeeded on Windows 32-bit.
View gist:ba97de07fe9595df0f6f
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 Sep 17, 2014
photo-activation-nation.mplstyle
View gist:b88815e290ba55c1084a
# 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.
View Interactive Curve-Fitting in the IPython Notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Interactive Curve-Fitting in the IPython Notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View winter is coming.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Figure 3.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View HDF5 File Size.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.