I want to obtain the following dictioanary : {S1: 1,2 , S[2]: 1,3 , S[3]:2,3 , S[4]: 1,2 , S[5] : 1,3}
Asked
Active
Viewed 17 times
0
-
Use `df.groupby('Order')['Stages'].apply(list).to_dict()` – jezrael Feb 26 '21 at 11:06
-
i get the following result {1: [1], 2: [1], 3: [2], 4: [1], 5: [1], '': [2, 3, 3, 2, 3]} while i need to obtain this : {S[1]: 1,2 , S[2]: 1,3 , S[3]:2,3 , S[4]: 1,2 , S[5] : 1,3} – Imen Boujnah Feb 26 '21 at 11:12
-
hmmm, it is not valid dictonary, so impossible get it. – jezrael Feb 26 '21 at 11:20