I have a data frame of the following type
id alphabet
20 a
20 b
30 b
30 c
now, there are multiple non-unique ids. there are multiple non-unique alphabets also.
i would like the result in the following format
id alphabet_a alphabet_b alphabet_c
20 1 1 0
30 0 1 1
so, rows have been combined based on unique id, and one-hot encoding has been done on the values (alphabets).
how can this be done on a large scale data frame?