I am trying to write a wrapper method for a subclass DataFrame
class SubDataFrame(DataFrame):
...
a = SubDataFrame()
b = a.loc[row, column]
on the last line, I want to process the metadata separately in the class SubDataFramebefore or after processing locin the superclass.
I do not know how to implement this notation, because if I just define
def loc(self, *args, **kwargs)
The parenthesis SubDataFramenotation loc[]does not work. ( AttributeError: instancemethod has no attribute getitem).
I can not find documents on how to implement this.
source
share