how to solve this changing dataframe problem
2
1
let say i have a dataframe that consist of these two columns. User_id hotel_cluster 1 0 2 2 3 2 3 3 3 0 4 2 i want to change it into something like this. Do i need to write a function or is there a pandas way to do it? User_id hotel_cluster_0 hotel_cluster_1 hotel_cluster_2 hotel_cluster_3 1 1 0 0 0 2 0 0 1 0 3 1 0 1 1 4 0 0 1 0 Please help! Sorry if i am not posting the question in the right format Thank you!
python pandas dataframe
s...