In[181]:df.to_period('SMS').groupby('date').sum()---------------------------------------------------------------------------KeyErrorTraceback(most recent call
last)pandas/_libs/tslibs/frequencies.pyxinpandas._libs.tslibs.frequencies._period_str_to_code()KeyError:'SMS-15'Duringhandling of the above exception,another exception occurred:ValueErrorTraceback(most recent call
last)in---->1df.to_period('SMS').groupby('date').sum()~/.virtualenvs/py36/lib/python3.6/site-packages/pandas/core/frame.pyinto_period(self,freq,axis,copy)8350axis=self._get_axis_number(axis)8351ifaxis==0:->8352new_data.set_axis(1,self.index.to_period(freq=freq))8353elifaxis==1:8354new_data.set_axis(0,self.columns.to_period(freq=freq))~/.virtualenvs/py36/lib/python3.6/site-packages/pandas/core/accessor.pyinf(self,*args,**kwargs)91def_create_delegator_method(name):92deff(self,*args,**kwargs):--->93returnself._delegate_method(name,*args,**kwargs)9495f.__name__=name~/.virtualenvs/py36/lib/python3.6/site-packages/pandas/core/indexes/datetimelike.pyin_delegate_method(self,name,*args,**kwargs)811812def_delegate_method(self,name,*args,**kwargs):-->813result=operator.methodcaller(name,*args,**kwargs)(self._data)814ifnamenotinself._raw_methods:815result=Index(result,name=self.name)~/.virtualenvs/py36/lib/python3.6/site-packages/pandas/core/arrays/datetimes.pyinto_period(self,freq)1280freq=get_period_alias(freq)1281->1282returnPeriodArray._from_datetime64(self._data,freq,tz=self.tz)12831284defto_perioddelta(self,freq):~/.virtualenvs/py36/lib/python3.6/site-packages/pandas/core/arrays/period.pyin_from_datetime64(cls,data,freq,tz)273PeriodArray[freq]274"""
--> 275 data, freq = dt64arr_to_periodarr(data, freq, tz)
276 return cls(data, freq=freq)
277
~/.virtualenvs/py36/lib/python3.6/site-packages/pandas/core/arrays/period.py
in dt64arr_to_periodarr(data, freq, tz)
914 data = data._values
915
--> 916 base, mult = libfrequencies.get_freq_code(freq)
917 return libperiod.dt64arr_to_periodarr(data.view("i8"), base, tz), freq
918
pandas/_libs/tslibs/frequencies.pyx in
pandas._libs.tslibs.frequencies.get_freq_code()
pandas/_libs/tslibs/frequencies.pyx in
pandas._libs.tslibs.frequencies.get_freq_code()
pandas/_libs/tslibs/frequencies.pyx in
pandas._libs.tslibs.frequencies.get_freq_code()
pandas/_libs/tslibs/frequencies.pyx in
pandas._libs.tslibs.frequencies._period_str_to_code()
ValueError: Invalid frequency: SMS-15