From 5bccbb64f15f6fd8e5e48ad25c39ac31b04d4678 Mon Sep 17 00:00:00 2001 From: zengbin93 Date: Mon, 2 Sep 2024 11:51:14 +0800 Subject: [PATCH] 0.9.59 fix dt type error --- czsc/traders/weight_backtest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/czsc/traders/weight_backtest.py b/czsc/traders/weight_backtest.py index f89ae8415..8315512d2 100644 --- a/czsc/traders/weight_backtest.py +++ b/czsc/traders/weight_backtest.py @@ -277,6 +277,7 @@ def __init__(self, dfw, digits=2, **kwargs) -> None: """ self.kwargs = kwargs self.dfw = dfw.copy() + self.dfw["dt"] = pd.to_datetime(self.dfw["dt"]) if self.dfw.isnull().sum().sum() > 0: raise ValueError("dfw 中存在空值, 请先处理") self.digits = digits