Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

执行yahoo normalize data 发生 ValueError: unconverted data remains when parsing with format "%Y-%m-%d" 错误 #2014

Copy link
Copy link
@lianzhaowen

Description

@lianzhaowen
Issue body actions

🐛 Bug Description

To Reproduce

Steps to reproduce the behavior:

1.python scripts/data_collector/yahoo/collector.py normalize_data --source_dir ~/.qlib/stock_data/source/cn_data --normalize_dir ~/.qlib/stock_data/normalize/cn_data --region CN --interval 1d
2.我已经下载了cn_data数据,normalize 过程中,在第341 sh600489.csv 发生错误

Expected Behavior

Screenshot

File "E:\Data\PROGRAM\Python\source\qlib\scripts\data_collector\yahoo\collector.py", line 395, in normalize_yahoo
df.index = pd.to_datetime(df.index)
...

ValueError: unconverted data remains when parsing with format "%Y-%m-%d": " 09:30:00+08:00", at position 1343. You might want to try:
- passing format if your strings have a consistent format;
- passing format='ISO8601' if your strings are all ISO8601 but not necessarily in exactly the same format;
- passing format='mixed', and the format will be inferred for each element individually. You might want to use dayfirst alongside this.

Environment

Note: User could run cd scripts && python collect_info.py all under project directory to get system information
and paste them here directly.

  • Qlib version:0.9.7
  • Python version: 3.12.9
  • OS (Windows, Linux, MacOS): windows

下载的原始数据
sh600468.csv
sh600469.csv

归一后的数据

sh600467.csv
sh600468.csv

  • Commit number (optional, please provide it if you are using the dev version):

Additional Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.