i have following pandas dataframe:
the table contains information products bought clients , respective quantities.
i want create matrix of client(rows) x product(columns) , fill quantities , input zeros when client did not buy product, following:
how can that?
thanks,
rodrigo.
df.set_index(['user','products']).unstack()
Comments
Post a Comment