Skip to content

set allowed for index argument in Series, index and columns for DataFrame.from_records() #55425

Open
@Dr-Irv

Description

@Dr-Irv

In #47215 I brought up the issue of allowing sets as arguments for the DataFrame constructor. This was addressed in #47231 . But there are a few more cases that should be fixed:

>>> pd.Series([3,4,5], index=set(["a", "b", "c"]))
c    3
a    4
b    5
dtype: int64
>>> pd.DataFrame.from_records([[1,2,3]], columns=set(["a", "b", "c"]), index=set(["x", "y", "z"]))
   c  a  b
x  1  2  3
y  1  2  3
z  1  2  3

We shouldn't allow a set as an argument for index or columns in both these cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API - ConsistencyInternal Consistency of API/BehaviorDataFrameDataFrame data structureSeriesSeries data structure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions