In [4]:
import matplotlib.pyplot as plt
In [5]:
import pandas as pd
In [6]:
boston=pd.read_csv("https://vincentarelbundock.github.io/Rdatasets/csv/MASS/Boston.csv")
In [8]:
boston.head()
Out[8]:
In [9]:
boston=boston.drop("Unnamed: 0",1)
In [10]:
var=boston.groupby('chas').medv.mean().reset_index()
In [11]:
plt.plot(var.chas,var.medv)
Out[11]:
In [12]:
plt.xlabel("Charles River Facing Tract")
Out[12]:
In [13]:
plt.ylabel("Median Prices")
Out[13]:
In [14]:
plt.show()
In [ ]: