Mypy/typeshed stubs for Pandas

Just checking to see if anybody listening has already generated a sort-of-working set of mypy/typeshed stubs for Pandas. I naively ran stubgen over the local Pandas install which generated some errors. I can go with what I have to start with, but was hoping someone else had pushed the ball further. (Nothing obvious turned up on GitHub, though there is an old ticket for stubs.)


I have not yet found stubs for pandas, however someone has created some for NumPy: https://github.com/machinalis/mypy-data/tree/master/numpy-mypy

One interim option could be to define a custom type according to how mypy sees pandas objects. When I wrap a DataFrame object in reveal_type(df) and run mypy, it reveals that the recognized type signature is Union[builtins.dict[Union[builtins.str, builtins.int], builtins.dict[Any, Any]], Any] . However it shows the same for a Series object, so it's not very accurate.

链接地址: http://www.djcxy.com/p/94278.html

上一篇: 如何在打字稿中使用提取

下一篇: Mypy / Pandas的分类存根