Hi all!

What's wrong with this?

import pandas as pd
x=pd.to_datetime("20160501")

x+pd.DateOffset(days=1)
Timestamp('2016-05-02 00:00:00', tz=None)

x.__add__(pd.DateOffset(days=1))
NotImplemented


More generally I have a class derived from pandas.datetime and I want to
implement its own __add__ that at a given point call super __add__.

For example:

class C(pandas.datetime):
        ...
        def __add__(self,n):
                ...
                r=super(C,self).__add__(pd.DateOffset(days=n))
                ...
BTW, in the last line is it needed and how to "cast" self to
pandas.datetime?

Thanks for any help
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to