#!/opt/local/bin/python

# -*- coding: utf-8 -*-

import pandas as pd
import numpy
# any additional libraries would be imported here

data = pd.read_csv( 'ool_pds.csv',sep=',',error_bad_lines=False)

# print "****", (len(data))
# # number of observations (rows)
# print "----",(len(data.columns)) # number of variables (columns)

# any additional libraries would be imported here


#setting variables you will be working with to numeric
# data['W1_J1_D'] = data['W1_J1_D'].convert_objects(convert_numeric=True)
# data['W1_J1_D'] = pd.to_numeric(data['W1_J1_D'])
# data['W2_QF4A'] = data['W2_QF4A'].convert_objects(convert_numeric=True)
# data['W2_QF5A'] = data['W2_QF5A'].convert_objects(convert_numeric=True)
# data['W2_WEIGHT3'] = data['W2_WEIGHT3'].convert_objects(convert_numeric=True)
# data['AGE'] = data['AGE'].convert_objects(convert_numeric=True)
print " Using OutlookOnLife dataset I look at 4 categories:"


#counts and percentages (i.e. frequency distributions) for each variable
print " Category 1: Require that an equal number of the top leadership positions in government go to women"
print (len(data['W1_J1_D'])), "number of observations (number of people)"
print "number of people voted as 0 - bad proposal and 10 - very good proposal "
print  "interpretation - the biggest number of people voted 5 wchi is on the middle. This does not agree on equality of " \
       "women getting on this positions  "
c1 = data['W1_J1_D'].value_counts(sort=True)
print c1
p1 = data['W1_J1_D'].value_counts(sort=False, normalize=True)
print p1
print
print "--------------------------------------------------------------------------------------------------------------"
print "Category 2: Churches or places of worship should allow more women to become members of the clergy."
print (len(data['W1_M4'])), "number of observations (number of people)"
print "number of people voted as 1 - strongly agree and 4 - strongly disagree "
print  "interpretation - the biggest number of people somewhat agree. This does not agree on equality of " \
       "women getting on this positions  " \
       "Also relatively large number of people refused to answer this question"

c2 = data['W1_M4'].value_counts(sort=False)
print(c2)
p2 = data['W1_M4'].value_counts(sort=True, normalize=True)
print (p2)
print
print "---------------------------------------------------------------------------------------------------------------"
print "Category 3: How concerned are you personally about women's rights?"

print (len(data['W1_M4'])), "number of observations (number of people)"
print "number of people voted as 1 - strongly agree and 4 - strongly disagree "
print  "interpretation - the biggest number of people somewhat agree. This does not agree on equality of " \
       "women getting on this positions  " \
       "Relatively large number of people refused to answer this question"

c3 = data['W2_QF9'].value_counts(sort=False)
print(c3)

p3 = data['W2_QF9'].value_counts(sort=False, normalize=True)
print (p3)
print
print "--------------------------------------------------------------------------------------------------------------"
print "Category 4:Discrimination against women is no longer a problem in the U.S"

print (len(data['W2_QH1'])), "number of observations (number of people)"
print " Discrimination against women is no longer a problem in the U.S. Do you agrees" \
      "people responded with 1 - Agree strongly to 5 disagree strongly and everything in between  "
print  "interpretation - 580 people somewhat disagree, which means that this is still an issue.  " \
       "Large number of records (693) are missing from this variable"

c4 = data['W2_QH1'].value_counts(sort=False)
print(c4)

p4 = data['W2_QH1'].value_counts(sort=False, normalize=True)
print (p4)
print "---------------------------------------------------------------------------------------------------------------"
print




output from this program