Hey I would like to turn python table from
| Number | Alphabet |
|---|---|
| 1 | A |
| 1 | B |
| 1 | C |
| 2 | A |
| 2 | B |
| 3 | A |
To table
| Number | Alphabet |
|---|---|
| 1 | A B C |
| 2 | A B |
| 3 | A |
I know how to add normal table using dataframe
import pandas as pd
data = {'Alphabet': ['A', 'B', 'C', 'D', 'E'],
'Number': [1, 2, 3, 4, 5]
}
df = pd.DataFrame(data)
print (df)
But not the second table