I have a data frame which can has n number of P_Id values for each Id.
X = Id P_Id Value
1 a_1 56
1 a_2 76
2 a_1 67
2 a_2 78
2 a_3 98
I have another data frame
Y = Id Name
1 Erwin
2 Joseph
3 Nik
I want the out put data frame to be
Output = Id a_1 a_2 a_3 Name
1 56 76 nan Erwin
2 67 78 98 Joseph