import csv as csv

csv_file_object = csv.reader(open('titanic_train.csv', 'rb'))

header = csv_file_object.next()
print(header)

lines = [line for line in csv_file_object]

print(lines[0])

print(lines[1])

"""
Explanation: Real data is messy
Titanic
End of explanation
"""


import pandas as pd
titanic_train = pd.read_csv("titanic_train.csv")

titanic_train

"""
Explanation: Use pandas!
End of explanation
"""


community_leading_cause = pd.read_csv("LEADINGCAUSESOFDEATH.csv")
community_leading_cause

"""
Explanation: Community health status from data.gov
End of explanation
"""


users = pd.read_csv("users.csv")

users

print("Number of users: %d" % len(users))
print("Unique locations: %d" % len(users.location.value_counts()))

users.location.value_counts()

"""
Explanation: -9999 Indicate N.A. value from the source data for the Unemployed column on the VUNERABLEPOPSANDENVHEALTH page
-2222 or -2222.2 or -2 nda, no data available, see Data Notes document for details
-1111.1 or -1111 or -1 nrf, no report, see Data Notes document for details
Twitter user locations
End of explanation
"""


