pandas count values by 1 year in column code example Example: pandas count values by column df = pd.DataFrame({'a':list('abssbab')}) df.groupby('a').count()