working through the python for data analysis book, done with numpy