import yfinance as yf
import pandas as pd
# Download historical data for required stocks
ohlcv_data = {}
# Define tickers list
tickers = ['AAPL', 'MSFT', 'GOOG'] # Example tickers
# Looping over tickers and storing OHLCV dataframe in dictionary
for ticker in tickers:
temp = yf.download(ticker, period='1mo', interval='15m')
temp.dropna(how="any", inplace=True)
ohlcv_data[ticker] = temp
I am trying to access/read the data from ohlcv_data through data wrangler , however it throws below error message.
Failed to load the data frame: ValueError: Must pass 2-d input. shape=(3, 1, 572, 6)
I believe this is due to the temp which in this case is multi dimensional.
What would be the alternative or fix to this issue.