Skip to content

Commit

Permalink
[Fix] 添加对缺失值的处理
Browse files Browse the repository at this point in the history
  • Loading branch information
Edanflame committed Nov 17, 2021
1 parent 04a1668 commit 8c1636d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vnpy_tushare/tushare_datafeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ def query_bar_history(self, req: HistoryRequest) -> Optional[List[BarData]]:
bar_dict: Dict[datetime, BarData] = {}
data: List[BarData] = []

# 处理原始数据中的NaN值
df.fillna(0, inplace=True)

if df is not None:
for ix, row in df.iterrows():
if row["open"] is None:
Expand Down

0 comments on commit 8c1636d

Please sign in to comment.