-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mypy complains about slicing a DateTimeIndex #397
Comments
On second glance, this may be something where my code hasn't narrowed down the index type of |
I think you'll need a more complete example that can be tested by others. Having said that, I get the same error on this simple code with import pandas as pd
df = pd.DataFrame({"c1":[1,2,3,4], "c2":[10,20,30,40]}, index=["a", "b", "c" , "d"])
x = df.loc["b":"c", :] Seems like a long standing issue. See I'm going to close this given that it seems to be a known issue with |
reopening so we can track if mypy ever fixes the bug |
It seems that PEP 696 is going to be deferred indefinitely. I was thinking - given that now typeshed added |
I'm open to a PR that does this. Should probably add a comment that you're adding |
Still an issue with mypy 1.14.1. Another user reported the pandas issue at python/mypy#2410 (comment) |
There was a recent typeshed update to make I'm not sure if the latest Mypy includes that, but if it does, I would think that would allow supporting this |
I just tried it with mypy 1.15.0+dev.bac9984a0e2696eed5d65ca49d006c545ba83a54 and slicing on strings doesn't work. If you do |
Shortened code:
Error:
I don't know yet whether this is a stubs issue or potentially a MyPy issue - could even be an issue with my code - I will investigate further
The text was updated successfully, but these errors were encountered: