I have a table which e.g. looks like this
Food | Compound | Content in grams |
---|---|---|
Kiwi | Fat | 5 |
Kiwi | Protein | 3 |
Apple | Protein | 2 |
I want to pivot it with pandas, so that it looks like
Food | Fat | Protein |
---|---|---|
Kiwi | 5 | 3 |
Apple | 2 | 0 |
Thanks in Advance!
I have a table which e.g. looks like this
Food | Compound | Content in grams |
---|---|---|
Kiwi | Fat | 5 |
Kiwi | Protein | 3 |
Apple | Protein | 2 |
I want to pivot it with pandas, so that it looks like
Food | Fat | Protein |
---|---|---|
Kiwi | 5 | 3 |
Apple | 2 | 0 |
Thanks in Advance!