Skip to content

Flags using list[str] for columns and index on pd.DataFrame #1657

@wyfok

Description

@wyfok

Describe the Bug

Extension flags errors for using list[str] for columns and index on pandas.DataFrame , even though both accept array-like

Argumentlist[str]is not assignable to parametercolumnswith typeExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray[tuple[Any, ...], dtype[Any]] | range | Nonein functionpandas.core.frame.DataFrame.init`

Argument list[str] is not assignable to parameter index with type ExtensionArray | Index | SequenceNotStr[Unknown] | Series | ndarray[tuple[Any, ...], dtype[Any]] | range | None in function pandas.core.frame.DataFrame.__init__
`

code

import pandas as pd 
df = pd.DataFrame(columns=['a', 'b', 'c'], index=['a','b','c'])

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions