application_vnd.jupyter.stderr_output_1.png
import matplotlib.pyplot as plt

def priceOverTime(data, label):
    """Plot price over time"""
priceOverTime(newdf3, 'California')
priceOverTime(newdf4, 'Colorado')
priceOverTime(newdf5, 'Michigan')

def priceOverTime2(data, label):
    data.groupby(data.Date.dt.year)['MedianSoldPrice_AllHomes'].mean().plot(kind='bar', figsize=(10, 6), color='grey', edgecolor='black', linewidth=2)
    plt.suptitle(label, fontsize=12)
    plt.ylabel('MedianSoldPrice_AllHomes')
    plt.xlabel('Year')
    plt.show()
priceOverTime2(newdf6, 'San Francisco')
priceOverTime2(newdf7, 'Denver')
priceOverTime2(newdf8, 'Detroit')