From 26d75b71b021c6058c9f037f8a20938a1b35e6e9 Mon Sep 17 00:00:00 2001 From: you-n-g Date: Wed, 19 May 2021 15:06:47 +0800 Subject: [PATCH] Update sample.py --- qlib/utils/sample.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qlib/utils/sample.py b/qlib/utils/sample.py index 9f67d4981..5568fc244 100644 --- a/qlib/utils/sample.py +++ b/qlib/utils/sample.py @@ -35,7 +35,7 @@ def parse_freq(freq: str) -> Tuple[int, str]: raise ValueError( "freq format is not supported, the freq should be like (n)month/mon, (n)week/w, (n)day/d, (n)minute/min" ) - _count = int(match_obj.group(1) if match_obj.group(1) else "1") + _count = int(match_obj.group(1)) if match_obj.group(1) is None else 1 _freq = match_obj.group(2) _freq_format_dict = { "month": "month",