diff --git a/qlib/data/cache.py b/qlib/data/cache.py index 2d0b8a7cd..3e0680e74 100644 --- a/qlib/data/cache.py +++ b/qlib/data/cache.py @@ -237,7 +237,7 @@ class CacheUtils: lock.acquire() except redis_lock.AlreadyAcquired: raise QlibCacheException( - f"""It sees the key(lock:{repr(lock_name)[1:-1]}-wlock) of the redis lock has existed in your redis db now. + f"""It sees the key(lock:{repr(lock_name)[1:-1]}-wlock) of the redis lock has existed in your redis db now. You can use the following command to clear your redis keys and rerun your commands: $ redis-cli > select {C.redis_task_db} @@ -784,10 +784,10 @@ class DiskDatasetCache(DatasetCache): def build_index_from_data(data, start_index=0): if data.empty: return pd.DataFrame() - line_data = data.iloc[:, 0].fillna(0).groupby("datetime").count() + line_data = data.groupby("datetime").size() line_data.sort_index(inplace=True) index_end = line_data.cumsum() - index_start = index_end.shift(1).fillna(0) + index_start = index_end.shift(1, fill_value=0) index_data = pd.DataFrame() index_data["start"] = index_start