I have a dataframe that is structured like this:
| ID | CustRef |
|---|---|
| 0 | 111 |
| 1 | 222 |
| 2 | 333, 444, 555, 666 |
It is simple enough to convert it to a dictionary using to_dict but where there are multiple CustRefs I would like those values to be converted to a list.
So, in this example the dict would be:
result_dict = {'0': 111, '1': 222, '2': [333, 444, 555, 666}}
Is that possible?