Skip to content

Instantly share code, notes, and snippets.

@anielsen001
anielsen001 / pandas_datetime.py
Created October 29, 2018 10:14
pandas datetime conversion options
try:
# python 3
from io import StringIO
except:
# python 2
from StringIO import StringIO
# some examples from
# https://stackoverflow.com/questions/17978092/combine-date-and-time-columns-using-python-pandas
@anielsen001
anielsen001 / opencv-build.org
Last active March 6, 2019 02:09
How I build opencv with python bindings

Building and installing opencv with python bindings

dependencies

sudo apt install ffmpeg
sudo apt install libgtk-3-dev
sudo apt install libv4l-dev
sudo apt install libtiff-dev
sudo apt install libwebp-dev
@anielsen001
anielsen001 / ofx-to-ledger.py
Created October 20, 2018 11:58 — forked from code-affinity/ofx-to-ledger.py
Python script for importing OFX files into a ledger-cli file
from __future__ import print_function
from ofxparse import OfxParser
import os
import re
import sys
if len(sys.argv) != 1:
print ('This utility does not take command-line arguments')
exit()
@anielsen001
anielsen001 / pdsns.py
Created August 21, 2018 10:25
analysis example with pandas and seaborn
import matplotlib.pylab as plt
import seaborn as sns
import pandas as pd
nosoi = pd.read_csv('roc3.txt', names = ['file','name','score'],na_values = ['None','no_persons_found'] )
nosoi.assign(truth=False) # create a column of "false"
soi = pd.read_csv('roc_known.txt', names = ['file','name','score'], na_values = ['None','no_persons_found'] )
soi.assign(truth=True) # create a column of Truth = True
@anielsen001
anielsen001 / bspline_change.py
Last active September 9, 2016 11:06
scipy bspline complex interpolation
from numpy import *
from scipy.signal import cubic
def cspline1d_eval(cj, newx, dx=1.0, x0=0):
"""Evaluate a spline at the new set of points.
`dx` is the old sample-spacing while `x0` was the old origin. In
other-words the old-sample points (knot-points) for which the `cj`
represent spline coefficients were at equally-spaced points of: