0

As titled,I have a dataframe that looks like this:

Date         Asset_name trade_price
2022-08-01   Asset 1      96
2022-08-01   Asset 2      94
2022-08-01   Asset 3      99
2022-08-01   Asset 4      98
2022-08-01   Asset 5      91
2022-08-02   Asset 1      ...
....

I want a dataframe like this:

Date          Asset 1     Asset 2    Asset 3   Asset 4  Asset 5
2022-08-01     96          94          99        98       91
2022-08-02     ...                         

I'm confused on whether it should be done using transpose or melt. Any help will be appreciated!

Alex
  • 81
  • 6
  • Does this answer your question? [How can I pivot a dataframe?](https://stackoverflow.com/questions/47152691/how-can-i-pivot-a-dataframe) – Ynjxsjmh Mar 03 '23 at 01:12

0 Answers0