IIUC,
df.set_index(['ID','User'])['Rating'].unstack('User').reset_index()
OR
df.pivot('ID','User','Rating').reset_index()
Output:
User ID type 1 type 2 0 1 4 5 1 2 3 2 2 3 1 5 3 4 4 3
1.4m articles
1.4m replys
5 comments
57.0k users