Create a new dataframe based on the data in the other dataframe
I was looking for an efficient method to populate new dataframe. I don't want to use for, iterrows etc if possible
Do not want to opt for:
for index, row in Df1.interrows():
Input Df1: Source
Index set
A {aa, dd}
B {cc}
C {dd,bb}
D {aa,cc,dd,bb}
E {cc}
Output Df:
Index aa bb cc dd
A 1 0 0 1
B 0 0 1 0
C 0 1 0 1
D 1 1 1 1
E 0 0 1 0