Assignment #2: Using the 2013_NYC_CD_MedianIncome_Recycle.xlsx file, calculate the correlation between the recycling rate and the median income. Discuss your findings in your PR.
In [10]:
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
df = pd.read_excel('2013_NYC_CD_MedianIncome_Recycle.xlsx')
In [3]:
df.head(3)
Out[3]:
In [4]:
df.corr()
Out[4]:
In [16]:
df.plot(kind='scatter', x='MdHHIncE', y='RecycleRate')
plt.title('Correlation between Median Income and Recycle Rate')
plt.xlabel('Median Income')
Out[16]: