You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, the actual pandas implementation clearly accepts a NumPy array (and other array-like objects). For reference, the stub for _iLocIndexerFrame already accommodates NumPy arrays.
It should be TakeIndexer, which is defined in _typing.pyi. PR with tests welcome.
Ideally, there should be some reconciliation done between the definitions of take() in series.pyi and frame.pyi, and if they are supposed to be the same, removed from those 2 files and placed in generic.pyi in NDFrame.
The following code executes without any runtime error, but static type checkers such as mypy flag it as invalid:
In pandas-stubs, the signature for
DataFrame.take
currently restricts indices tolist
:However, the actual pandas implementation clearly accepts a NumPy array (and other array-like objects). For reference, the stub for
_iLocIndexerFrame
already accommodates NumPy arrays.It would be helpful if the take method signature could be fixed!
The text was updated successfully, but these errors were encountered: