是否有可能从DataFrame
中访问我的访问者所属的pandas accessor class?
具体来说,我想让accessor类中的一个方法通过df
为主数据框df.myaccessor.calc_displacement()
分配一个系列,x
在y
中的df
和_obj
列上运行。
相反,我可以访问的最多的是访问者可见的pandas DataFrame _obj
。但更新df
不会更新dir(self)
。
从['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_obj', '_validate']
的访问者类中:
GeoAccessor
在查看了访问器的公共示例(例如,.dt
,qazxswpoi)之后,遗憾的是,似乎没有内置方法。