import pandas as pd # Calculate review frequencies by year data['year'] = pd.DatetimeIndex(data['period']).year rows_count = data.groupby('year', as_index=False).year.value_counts() rows_count.columns=['year','reviews'] import matplotlib.pyplot as plt # Generate a line plot rows_count.plot.line(x='year',y = 'reviews') plt.show()