i have a dataframe like this:
df.head()
Out[2]:
price sale_date
0 477,000,000 1396/10/30
1 608,700,000 1396/10/30
2 580,000,000 1396/10/03
3 350,000,000 1396/10/03
4 328,000,000 1396/03/18
that it has out of bounds datetime
so then i follow below to make them as period time
df['sale_date']=df['sale_date'].str.replace('/','').astype(int)
def conv(x):
return pd.Period(year=x // 10000,
month=x // 100 % 100,
day=x % 100, freq='D')
df['sale_date'] = df['sale_date'].str.replace('/','').astype(int).apply(conv)
now i want to resample them by day like below:
df.resample(freq='d', on='sale_date').sum()
but it gives me this error:
resample() got an unexpected keyword argument 'freq'