My Netas with PANDAS

Election_2014_Candidates_pandasWas surfing internet and found this affidavit data filled by candidates of election 2014 in a convenient comma separated file format.

Couldn’t resist myself. The tinkerer in me wanted to play with this data, so tinkering began.

# Data Source
import numpy as np
import pandas as pd
import matplotlib

%matplotlib inline


data =pd.read_csv(fname)

Using Pandas library, loaded the data and first two results brought some surprises. So spent the next couple hours digging the data.

Ok answer this

  • Which party has the highest count of registered criminal cases ?
  • Which party do the top two most criminal cases candidate belong to?

Answer before you proceed. I was surprised by the answer this data revealed!

I also found answers to these questions.

  • How many candidates were running in the election?
  • How many parties were contesting elections?
  • What is the Education Status of candidates in different party?
  • Who is the richest contestant by total assets?

and many more.

Find out. And while you are at it, you might learn some pandas. I am still a beginner in pandas and might not have done full justice to the awesome pandas library!!

Here’s the notebook to check the code and the results. And if you prefer PDF, then click here.

Visit my github to play with the data and the code.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s