Skip to content

Type is not infered when iterating over df.columns #30

Closed
@alkatar21

Description

@alkatar21

I don't know if currently only pyright: basic support is targeted? If not it would be nice if this could be infered, since as far as I know it should always be str.

# pyright: strict
import pandas as pd

df = pd.DataFrame()

for name in df.columns:  # Type of "name" is unknown Pylance(reportUnknownVariableType)
    print(name)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions