I have a dataframe with two columns:id and vendor_name as given below:
id vendor_name
1 vendor1
1 vendor2
2 vendor1
I want to transform it as follows:
id vendor_name1 vendor_name2
1 vendor1 vendor2
2 vendor1 nan
Is there a way i can acheive this in pandas?