For example, I have:
Column A Column B Column C
A_1 B_1 0
A_1 B_2 1
A_2 B_3 3
A_2 B_5 2
I would like to get this:
B_1 B_2 B_3 B_5
A_1 0 1 nan nan
A_2 nan nan 3 2
My idea is to get the unique values of Column A and Column B, recreate a new dataframe based on that and fill in the blanks through 2 for loops. Is there a better way to do this using Pandas? My method takes too long with large dataframe.