pandas.errors.AbstractMethodError #

异常 pandas.errors。AbstractMethodError ( class_instance , methodtype = 'method' ) [来源] #

对于抽象方法,引发此错误而不是 NotImplementedError。

例子

>>> class Foo:
...     @classmethod
...     def classmethod(cls):
...         raise pd.errors.AbstractMethodError(cls, methodtype="classmethod")
...     def method(self):
...         raise pd.errors.AbstractMethodError(self)
>>> test = Foo.classmethod()
Traceback (most recent call last):
AbstractMethodError: This classmethod must be defined in the concrete class Foo
>>> test2 = Foo().method()
Traceback (most recent call last):
AbstractMethodError: This classmethod must be defined in the concrete class Foo