Skip to content
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 using strings #1079

Open
Dr-Irv opened this issue Jan 3, 2025 · 0 comments
Open

mypy complains about slicing using strings #1079

Dr-Irv opened this issue Jan 3, 2025 · 0 comments
Labels
mypy bug Requires mypy to fix a bug

Comments

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Jan 3, 2025

See discussion in #397

Having said that, I get the same error on this simple code with mypy, so it seems it is a mypy problem, as pyright allows this:

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
python/mypy#2410
python/typeshed#8647

Originally posted by @Dr-Irv in #397 (comment)

@Dr-Irv Dr-Irv added the mypy bug Requires mypy to fix a bug label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mypy bug Requires mypy to fix a bug
Projects
None yet
Development

No branches or pull requests

1 participant