You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The set is being replicated n times, n being the length of the actual set.
While defining a column with a set directly might not make a lot of sense given that they are by definition unordered collections, the behaviour in any case seems clearly unexpected.
Expected Output
In the case of a list, in order to obtain a single row containing a list, we would have to define a nested list, such as pd.DataFrame({'a':[[1,2,3]]}).
So similarly, with sets I would expect the same behaviour by defining the row with pd.DataFrame({'a':[{1,2,3}]}).
In the case of a single set, even if the order is not guaranteed to be preserved, I'd see more reasonable the same output that we would obtain with:
pd.DataFrame({'a':[1,2,3]})
a011223
So:
pd.DataFrame({'a':{1,2,3}})
a011223
Where:
pd.__version__# '1.0.0'
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Code Sample
If we try to define a dataframe using a dictionary containing a set, we get:
Problem description
The set is being replicated
n
times,n
being the length of the actual set.While defining a column with a set directly might not make a lot of sense given that they are by definition unordered collections, the behaviour in any case seems clearly unexpected.
Expected Output
In the case of a list, in order to obtain a single row containing a list, we would have to define a nested list, such as
pd.DataFrame({'a':[[1,2,3]]})
.So similarly, with sets I would expect the same behaviour by defining the row with
pd.DataFrame({'a':[{1,2,3}]})
.In the case of a single set, even if the order is not guaranteed to be preserved, I'd see more reasonable the same output that we would obtain with:
So:
Where:
The text was updated successfully, but these errors were encountered: