Given data as follows:
| x | y |
|---|---|
| a | d1 |
| a | d2 |
| b | d1 |
| b | d3 |
would like to create:
| thing | d1 | d2 | d3 |
|---|---|---|---|
| a | True | True | False |
| b | True | False | True |
example data:
data_from_csv = 'x,y\na,d1\na,d2\nb,d1\nb,d3\n'
data_to_csv = 'thing,d1,d2,d3\na,True,True,False\nb,True,False,True\n'
----------
I thought there was some sort of unstacking which could be done here but I can't seem to get it working.