Open aaronkurz opened 4 months ago
Many thank for isolating this issue. We try to use overload
s to get the right type out of loc
selections, but still have more work to do. In this case, it might be possible to improve the static analysis by identifying that the type of selection is by Boolean array. I will investigate and see if I can improve this.
Description
When filtering values of a Frame, the resulting type is indicated to be Series, even when the result has more than one row and thus is a Frame. When executing the code and testing, the type is indeed Frame, but the PyCharm type checker complains about wrong type usage. This might be an issue with PyCharm, with my code or with static-frame. But since PyCharm is a pretty common IDE, I still wanted to bring this up and ask for clarification.
Example
Provide an interactive Python session, or Python code, to demonstrate the issue. Please keep example data to a minimum.
Output:
Type hint/inference:![image](https://github.com/static-frame/static-frame/assets/62746723/3eacecb9-84a4-405f-b4fa-7cf6244af5ea)
Platform
Run the following function (static-frame >= 0.8.1) and provide the results to define your platform and environment:
Output: