From a dataframe, I want to create a dataframe with new columns if the index is already found without knowing how many columns I will create :
pd.DataFrame([["John","guitar"],["Michael","football"],["Andrew","running"],["John","dancing"],["Andrew","cars"]]) and I want :
pd.DataFrame([["John","guitar","dancing"],["Michael","Football",None],["Andrew","running","cars"]]) without knowing how many columns I should create at the start.