I have the following DataFrame and ultimately want to divide the MarketCap of BTC by the Marketcap of ETH
Date Asset Price MarketCap
1/1/2022 BTC $10 $10000
1/2/2022 BTC $12 $10000
1/3/2022 BTC $11 $10000
1/1/2022 ETH $5 $2000
1/2/2022 ETH $6 $2000
1/3/2022 ETH $5 $2000
What is the most efficient way of converting the dataframe to this so i can do df['marketcap_btc'] / df['marketcap_eth']
Date Price_BTC MarketCap_BTC Price_ETH MarketCap_ETH
1/1/2022 $10 $10000 $5 $2000
1/2/2022 $12 $10000 $6 $2000
1/3/2022 $11 $10000 $5 $2000
Or if there is a more efficient alternative method that would work without restructuring the dataframe