Skip to content

Commit 83d5946

Browse files
author
michael xu
committed
pandas 1.43 or 2.0.1
1 parent 3695684 commit 83d5946

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

SkinokBacktraderUI.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,24 @@ def loadData(self, dataPath, datetimeFormat, separator):
112112

113113
# Python contains
114114
if not dataPath in self.dataframes:
115-
# self.dataframes[fileName] = pd.read_csv(dataPath,
116-
# sep=separator,
117-
# parse_dates=[0],
118-
# date_parser=lambda x: pd.to_datetime(x, format=datetimeFormat),
119-
# skiprows=0,
120-
# header=0,
121-
# names=["Time", "Open", "High", "Low", "Close", "Volume"],
122-
# index_col=0)
123-
self.dataframes[fileName] = pd.read_csv(dataPath,
124-
sep=separator,
125-
parse_dates=[0],
126-
date_format=datetimeFormat,
127-
skiprows=0,
128-
header=0,
129-
names=["Time", "Open", "High", "Low", "Close", "Volume"],
130-
index_col=0)
115+
if pd.__version__=='1.4.3':
116+
self.dataframes[fileName] = pd.read_csv(dataPath,
117+
sep=separator,
118+
parse_dates=[0],
119+
date_parser=lambda x: pd.to_datetime(x, format=datetimeFormat),
120+
skiprows=0,
121+
header=0,
122+
names=["Time", "Open", "High", "Low", "Close", "Volume"],
123+
index_col=0)
124+
else:
125+
self.dataframes[fileName] = pd.read_csv(dataPath,
126+
sep=separator,
127+
parse_dates=[0],
128+
date_format=datetimeFormat,
129+
skiprows=0,
130+
header=0,
131+
names=["Time", "Open", "High", "Low", "Close", "Volume"],
132+
index_col=0)
131133

132134
except ValueError as err:
133135
return False, "ValueError error:" + str(err)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy