0
whereas df is your Dataframe:
temp = df.groupby('data').cumcount() + 1
df = df.set_index(['data', temp]).unstack().sort_index(1, level=1)
df.columns = ['_'.join(map(str,i)) for i in df.columns]
0
1
whereas df is your Dataframe:
temp = df.groupby('data').cumcount() + 1
df = df.set_index(['data', temp]).unstack().sort_index(1, level=1)
df.columns = ['_'.join(map(str,i)) for i in df.columns]
Browser other questions tagged python-3.x pandas
You are not signed in. Login or sign up in order to post.
Hi Leonardo, it was perfect. Thank you very much.
– Heber Araujo