I was struggling with how to word the question, so I will provide an example of what I am trying to do below. I have a dataframe that looks like this:
     ID     CODE    COST
0   60086   V2401   105.38
1   60142   V2500   221.58
2   60086   V2500   105.38
3   60134   V2750   35
4   60134   V2020   0
I am trying to create a dataframe that has the ID as rows, the CODE as columns, and the COST as values since the cost for the same code is different per ID. How can I do this in?
 
    