I have the following sample dataframe:

```
import pandas as pd

array = {'id': [1,1,1,2,2,2], 'color': ['orange', 'pink', 'blue', 'green', 'pink', 'orange']}
df = pd.DataFrame(array)
pd.get_dummies(df)

    id  blue green orange pink
0   1   0   0   1   0
1   1   0   0   0   1
2   1   1   0   0   0
3   2   0   1   0   0
4   2   0   0   0   1
5   2   0   0   1   0

```

Looking for a way to aggregate the dummies. Expected output:

```
    id  blue green orange pink
0   1   1   0   1   1
1   2   0   1   1   1

```

Problem is that the original dataframe has more than 2 mil rows. Using groupby:

```
df.groupby('id').max()

```

takes a few hours long.

Any ideas to make it quicker?