Skip to content

Instantly share code, notes, and snippets.

@LeoHuckvale
LeoHuckvale / gist:89683dc242f871c8e69b
Created Feb 2, 2015
matplotlib - Add subplots dynamically
View gist:89683dc242f871c8e69b
View useful_pandas_snippets.md

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

View gist:5e01bb76b8e797cf8f95
Given J*JT * x = b, solve for x in linear time and space.
J is m by n
x is m by 1
b is m by 1
m < n
J is a rectangular matrix that represents a tree with equal and opposite entries.
For example: