ranaroussi/yfinance

Dataframe with incorrect index type returned when combining two tickers (one without data)

已关闭

#1,382 创建于 2023年1月30日

 (6 条评论) (0 个反应) (0 位负责人)Python (3,404 个派生)batch import
Help wanted

仓库指标

星标
 (25,035 个星标)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 16 个 PR)

描述

import yfinance as yf
df = yf.download( tickers = ["^NDX", "^TWII"],       
                  start="2023-01-22", end="2023-01-29",
                  interval = "1m",
                  group_by = 'column',
                  auto_adjust = False,
                  prepost = True,
                  threads = True,
                  proxy = None
                  )
[*********************100%***********************]  2 of 2 completed

1 Failed download:
- ^TWII: No data found for this date range, symbol may be delisted

It's not delisted, it's just there as there is no data due to the lunar new year. The problem is the returned dataframe index is not a datetime index, but has type object)

yfinace version 0.2.9, python 3.10.8 on Linux ubuntu

贡献者指南