Skip to content

Instantly share code, notes, and snippets.

from collections import namedtuple
def seriesToTuple(s,name="IndexTuple"):
"""
Converts pandas Series `s` to a named tuple.
Args:
s (pd.Series): pandas Series object to convert
name (str): name of the resulting NamedTuple class
@jkokorian
jkokorian / example notebook: pandas for measurement data analysis.ipynb
Created April 22, 2016 12:11
This notebook shows how to use pandas to analyze some generated measurement data.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jkokorian
jkokorian / PyQt2WayBinding
Created May 24, 2015 14:18
PyQt observer class for 2-way binding
import PyQt4.QtCore as q
import PyQt4.QtGui as qt
class BindingEndpoint(object):
"""
Data object that contains the triplet of: getter, setter and change notification signal,
as well as the object instance and it's memory id to which the binding triplet belongs.
Parameters:
instance -- the object instance to which the getter, setter and changedSignal belong