Create analysis.py

Not sure yet exactly what this is does (I forgot). I'll check later.