You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgraded to yfinance 2.51 this week
yf.Download for a single ticker now produces columns with an un-wanted multi-index with an altered column order (CHLOV)
Am closing this issue as the API has a solution.
df = yf.download(tickers=[ticker], start=start_date, end=end_date, multi_level_index=False)
Seems we have lost AdjClose ?
Upgraded to yfinance 2.51 this week
yf.Download for a single ticker now produces columns with an un-wanted multi-index with an altered column order (CHLOV)
Example
start_date = '2023-01-01'
end_date = datetime.now().strftime('%Y-%m-%d')
ticker = 'TSLA'
df = yf.download(tickers=[ticker], start=start_date, end=end_date)
df.columns
MultiIndex([( 'Close', 'TSLA'),
( 'High', 'TSLA'),
( 'Low', 'TSLA'),
( 'Open', 'TSLA'),
('Volume', 'TSLA')],
names=['Price', 'Ticker'])
Workaround
df.columns = df.columns.to_flat_index()
... and then rename and re-order columns to OHLCV
The text was updated successfully, but these errors were encountered: