0

I have downloaded data for multiple indexes from Yahoo Finance using the yfinance package. However, my results are formated with multiIndex format and look like this.

AAPL FB
Date Open Close High Low Volume Date Open Close High Volume
2022-01-01 34.5 34.6 37.8 39.6 100000 2022-01-01 34.5 34.6 37.8 100000
2022-01-02 34.5 34.6 37.8 39.6 100000 2022-01-01 34.5 34.6 37.8 100000

I want to convert these tables, so my results are easier to access, and the format looks like this.

TICKER Date Open Close High Low Volume
AAPL 2022-01-01 35.5 34.6 37.8 31.6 100001
AAPL 2022-01-02 37.8 34.6 38.9 33.2 100002
FB 2022-01-01 24.5 27.6 29.8 19.6 100003
FB 2022-01-02 44.5 44.6 47.8 43.6 100004
Lola Ro
  • 27
  • 4
  • Seems like this is the answer you want - https://stackoverflow.com/questions/63107594/how-to-deal-with-multi-level-column-names-downloaded-with-yfinance/63107801#63107801 – inteoryx Nov 17 '22 at 18:02

0 Answers0