#!/usr/bin/python

""" 
    Starter code for exploring the Enron dataset (emails + finances);
    loads up the dataset (pickled dict of dicts).

    The dataset has the form:
    enron_data["LASTNAME FIRSTNAME MIDDLEINITIAL"] = { features_dict }

    {features_dict} is a dictionary of features associated with that person.
    You should explore features_dict as part of the mini-project,
    but here's an example to get you started:

    enron_data["SKILLING JEFFREY K"]["bonus"] = 5600000
    
"""

import pickle

enron_data = pickle.load(open("../final_project/final_project_dataset.pkl", "r"))
# count = 0
# for key, value in enron_data.iteritems():
#     if value['poi'] == 1:
#         count = count + 1
#
# print count

print enron_data['SKILLING JEFFREY K']
print enron_data['SKILLING JEFFREY K']['total_payments']
print enron_data['LAY KENNETH L']['total_payments']
print enron_data['FASTOW ANDREW S']['total_payments']

count = 0
for key, value in enron_data.iteritems():
    if value['total_payments'] == 'NaN':
        count = count + 1

print count

count2 = 0
for key, value in enron_data.iteritems():
    if value['total_payments'] == 'NaN' and value['poi'] == 1:
        count2 = count2 + 1

print count2

pois = 0
for key, value in enron_data.iteritems():
    if value['poi'] == 1:
        pois = pois + 1

print pois

print len(enron_data)
