You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ticker name "NA" in the "all.txt" under /instruments makes the exists_qlib_data function fail due to the string "NA" being wrongly converted to the float "nan" but not a string.
To Reproduce
Steps to reproduce the behavior:
Save the attached all.txt under the ~/.qlib/qlib_data/us_data/instruments.
Run the following code:
provider_uri="~/.qlib/qlib_data/us_data_new"# target_dirifnotexists_qlib_data(provider_uri):
print(f"Qlib data is not found in {provider_uri}")
sys.path.append(str(scripts_dir))
fromget_dataimportGetDataGetData().qlib_data(target_dir=provider_uri, region=REG_US)
Expected Behavior
The code should run without errors.
Screenshot
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.93
Python version: 3.8.10
OS (Windows, Linux, MacOS): Windows
Commit number (optional, please provide it if you are using the dev version):
Additional Notes
The bug is caused by the wrong usage of pandas.read_csv in the following line of exists_qlib_data under qlib\utils\__init__.py. Refer to the page for more details.
OzzyXu
changed the title
Ticker name "NaN" sometimes makes the exists_qlib_data function report errors.
Ticker name "NA" makes the exists_qlib_data function report errors.
Jan 4, 2024
@SunsetWolf Sure. Then I will double-check whether my fix will cause any issues, if not, then I will create a PR to fix it. And I am happy to be a contributor to Qlib and try to help with other issues.
🐛 Bug Description
The ticker name "NA" in the "all.txt" under
/instruments
makes theexists_qlib_data
function fail due to the string "NA" being wrongly converted to the float "nan" but not a string.To Reproduce
Steps to reproduce the behavior:
~/.qlib/qlib_data/us_data/instruments
.Expected Behavior
The code should run without errors.
Screenshot
Environment
Note: User could run
cd scripts && python collect_info.py all
under project directory to get system informationand paste them here directly.
Windows
,Linux
,MacOS
): WindowsAdditional Notes
exists_qlib_data
underqlib\utils\__init__.py
. Refer to the page for more details.keep_default_na=False
The text was updated successfully, but these errors were encountered: