-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
IndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvesNeeds TestsUnit test(s) needed to prevent regressionsUnit test(s) needed to prevent regressions
Milestone
Description
I have a dataframe with duplicated keys, and I need to assign values to some column of that dataframe, for some different keys. Dataframe indexes support duplicated keys, so I assume that this kind of work should be easy, if not I don't see why dataframes should be allowed to have duplicated keys. Anyway, setting the values like this:
df.loc[key, 'column']= vector
gives me the following error:
ValueError: Must have equal len keys and value when setting with an iterable
even if the number of times key
appears in the index of df
is equal to the length of vector
. I think this should be fixed.
Thank you,
c. foschi
Metadata
Metadata
Assignees
Labels
IndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvesNeeds TestsUnit test(s) needed to prevent regressionsUnit test(s) needed to prevent regressions