I have many dataframes read from pdf files. And they look like this:
e.g order 1 - this is a dataframe:
code description price quantity
000001 product A 1 10
000002 product B 2 20
000003 product C 3 30
...
order 2 - this is a dataframe:
code description price quantity
000001 product A 1 100
000002 product B 2 20
000004 product D 4 40
There will be orders 3, 4 etc I like to join them up and group by the code(which is unique) but display separately the quantities.
code description price order1 quantity order2 quantity
000001 product A 1 10 100
000002 product B 2 20 20
000003 product C 3 30 0
000004 product D 4 0 40
Apart from using tedious loops, I wonder if there is a cleaner way to achieve this in pandas. I used to process this in excel vba previously using ugly loops and is my first time trying it in pandas.
Thanks alot for any help!