Using data from this FiveThirtyEight post (http://fivethirtyeight.com/datalab/opinions-about-the-iran-deal-are-more-about-obama-than-iran/), write code to calculate the correlation of the responses from the poll. Respond to the story in your PR. Is this a good example of data journalism? Why or why not?


In [1]:
import pandas as pd

In [2]:
df = pd.read_excel("fox_survey.xlsx")

In [3]:
df.head()


Out[3]:
Obama Approval Iran Agreement Confidence Favor Iran Deal
Dem 78 29 60
Rep 10 4 34
Ind 37 15 44
Men 41 17 46
Women 47 17 47

In [4]:
df.corr()


Out[4]:
Obama Approval Iran Agreement Confidence Favor Iran Deal
Obama Approval 1.000000 0.936991 0.766848
Iran Agreement Confidence 0.936991 1.000000 0.764880
Favor Iran Deal 0.766848 0.764880 1.000000

In [ ]: