puneethmishra / pandas-cookbook

Recipes for using Python's pandas library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pandas cookbook

pandas is a Python library for doing data analysis. It's really fast and lets you do exploratory work incredibly quickly.

The goal of this cookbook is to give you some concrete examples for getting started with pandas. The docs are really comprehensive. However, I've often had people tell me that they have some trouble getting started, so these are examples with real-world data, and all the bugs and weirdness that that entails.

I'm working with 3 datasets right now

  • 311 calls in New York
  • How many people were on MontrĂ©al's bike paths in 2012
  • Montreal's weather for 2012, hourly

It comes with batteries (data) included, so you can try out all the examples right away.

Table of Contents

Installation

You'll need an up-to-date version of IPython Notebook (>= 1.0) and pandas (>=0.12) for this to work properly

You can get these using pip:

pip install ipython pandas numpy

Alternatively, I use and recommend Anaconda, which will give you everything you need. It's free and open source.

Once you have pandas and IPython, you can get going!

git clone https://github.com/jvns/pandas-cookbook.git
cd pandas-cookbook/cookbook
ipython notebook --pylab inline

A tab should open up in your browser at http://localhost:8888

Happy pandas!

Send me email!

Here's how this works: This is a prototype, and I haven't decided if it would be useful to continue with it yet. If you find it useful, send me email! If there's something you'd like to see, send me email!

TODO

  • Joining dataframes
  • Using stack/unstack
  • ???

About

Recipes for using Python's pandas library