Mypy / typeshed stubs for Pandas

Just checking to see if anyone had heard listening to the mypy / typeshed workgroup set for Pandas. I naively ran stubgen over a local Pandas installation that generated some errors. I can go with what I need to start with, but I hoped that someone else would push the ball further. (Nothing obvious appeared on GitHub, although there is an old ticket for stubs.)

+6
source share
1 answer

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

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

+4
source

Source: https://habr.com/ru/post/1013103/


All Articles