From 84e9a2084b524bb82e8a396923a2366778c79758 Mon Sep 17 00:00:00 2001 From: Joshua wang Date: Sat, 22 Feb 2020 17:59:24 +0800 Subject: [PATCH] =?UTF-8?q?bug=20fix:=20=E5=A6=82=E6=9E=9C=E6=97=A5?= =?UTF-8?q?=E7=BA=BF=E6=95=B0=E6=8D=AE=E4=B8=AD=E6=9F=90=E4=B8=AA=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E6=A0=BC=E5=BC=8F=E5=87=BA=E9=94=99=E4=BC=9A=E6=8A=9B?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=EF=BC=8C=E5=90=8E=E9=9D=A2=E6=89=80=E6=9C=89?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8D=B3=E4=BD=BF=E6=A0=BC=E5=BC=8F=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E4=B9=9F=E6=97=A0=E6=B3=95=E8=A7=A3=E9=87=8A=E5=87=BA?= =?UTF-8?q?=E6=9D=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pytdx/reader/daily_bar_reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytdx/reader/daily_bar_reader.py b/pytdx/reader/daily_bar_reader.py index b93f427..ae04099 100644 --- a/pytdx/reader/daily_bar_reader.py +++ b/pytdx/reader/daily_bar_reader.py @@ -65,7 +65,7 @@ def get_df_by_file(self, fname): data = [self._df_convert(row, coefficient) for row in self.parse_data_by_file(fname)] df = pd.DataFrame(data=data, columns=('date', 'open', 'high', 'low', 'close', 'amount', 'volume')) - df.index = pd.to_datetime(df.date) + df.index = pd.to_datetime(df.date, errors='coerce') return df[['open', 'high', 'low', 'close', 'amount', 'volume']] def get_df_by_code(self, code, exchange):