fig, ax = plt.subplots()
for key, grp in properties.groupby(['Boroughs']):
ax = grp.plot(ax=ax, kind='line', x='Date', y='Avg_Price', label=key)
plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left')
plt.show()
Exploring Culture Through Creativity, Data, and Storytelling
fig, ax = plt.subplots()
for key, grp in properties.groupby(['Boroughs']):
ax = grp.plot(ax=ax, kind='line', x='Date', y='Avg_Price', label=key)
plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left')
plt.show()