I have one dataframe as below. I want to add one column to store how many times the date occurs in this dataframe. Thanks.
import pandas as pd
import numpy as np
df2 = pd.DataFrame({
'date': [20130101,20130101, 20130105, 20130105, 20130107, 20130108],
'price': [25, 16.3, 23.5, 27, 40, 8],
})