Skip to content

Commit 6aaaae7

Browse files
author
shengyuhong
committed
fixed to_datetime
1 parent 4bf9e72 commit 6aaaae7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ tags
5050
./pretrain
5151
.idea/
5252
.aider*
53+
.python-version

scripts/data_collector/yahoo/collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def normalize_yahoo(
392392
columns = copy.deepcopy(YahooNormalize.COLUMNS)
393393
df = df.copy()
394394
df.set_index(date_field_name, inplace=True)
395-
df.index = pd.to_datetime(df.index)
395+
df.index = pd.to_datetime(df.index, errors="coerce")
396396
df.index = df.index.tz_localize(None)
397397
df = df[~df.index.duplicated(keep="first")]
398398
if calendar_list is not None:

0 commit comments

Comments
 (0)