I have
 a={0: ['I3925'], 1: ['I3925'], 2: ['I3925'], 3: ['I2355'], 4: ['I2355'], 5: ['I2355'], 6: ['I111'], 7: ['I111'], 8: ['I111'], 9: ['I405'], 10: ['I405'], 11: ['I3878', 'I2864'], 12: ['I3878'], 13: ['I534'], 14: ['I534'], 15: ['I134', 'I2276'], 16: ['I107'], 17: ['I107'], 18: ['I2864']}  
which contains one supplementary I number for one key.
b = pd.Series(a,\
                              index = a.keys(),
                               name = "a")
pd.get_dummies(b.apply(pd.Series))
then get_dummies is not working, as it creates a duplicate column 1_15 to store the match with the second I number, instead of stacking them into the same column. I don't understand why.
    0_I107  0_I111  0_I134  0_I2355 0_I2864 0_I3878 0_I3925 0_I405  0_I534  1_I2276 1_I2864
0   0   0   0   0   0   0   1   0   0   0   0
1   0   0   0   0   0   0   1   0   0   0   0
2   0   0   0   0   0   0   1   0   0   0   0
3   0   0   0   1   0   0   0   0   0   0   0
4   0   0   0   1   0   0   0   0   0   0   0
5   0   0   0   1   0   0   0   0   0   0   0
6   0   1   0   0   0   0   0   0   0   0   0
7   0   1   0   0   0   0   0   0   0   0   0
8   0   1   0   0   0   0   0   0   0   0   0
9   0   0   0   0   0   0   0   1   0   0   0
10  0   0   0   0   0   0   0   1   0   0   0
11  0   0   0   0   0   1   0   0   0   0   1
12  0   0   0   0   0   1   0   0   0   0   0
13  0   0   0   0   0   0   0   0   1   0   0
14  0   0   0   0   0   0   0   0   1   0   0
15  0   0   1   0   0   0   0   0   0   1   0
16  1   0   0   0   0   0   0   0   0   0   0
17  1   0   0   0   0   0   0   0   0   0   0
18  0   0   0   0   1   0   0   0   0   0   0
Could someone please explain what I am doing wrong?
 
                        
Something like this?
Output: