-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
set
allowed for index
argument in Series
, index
and columns
for DataFrame.from_records()
#55425
Comments
Do we need a deprecation for this, or is it OK to do as a breaking change like the previous PR? |
I think a breaking change is fine. |
Also do we want to disallow views on dicts? >>> data =[1, 2, 3]
>>> data
[1, 2, 3]
>>> d = {'a'+str(value): value for value in data}
>>> d
{'a1': 1, 'a2': 2, 'a3': 3}
>>> pd.Series(d.values(), index=d.keys())
a1 1
a2 2
a3 3
dtype: int64 The above works, but strictly speaking, If we agree those shouldn't be allowed, that might require a deprecation cycle. |
Also, for |
Here's another one. I think that sets shouldn't be allowed as the argument when constructing an >>> pd.Index(set([1,2]))
Index([1, 2], dtype='int64')
>>> pd.Index(set([2,1]))
Index([1, 2], dtype='int64') The order of the |
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:We shouldn't allow a
set
as an argument forindex
orcolumns
in both these cases.The text was updated successfully, but these errors were encountered: