Skip to content

mypy complains about slicing using strings #1079

Open
@Dr-Irv

Description

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)

Metadata

Assignees

No one assigned

    Labels

    mypy bugRequires mypy to fix a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions