From b2791836a42627f252a42f2feb060a8db882380f Mon Sep 17 00:00:00 2001 From: Stefano Ariestasia Date: Mon, 9 Jan 2023 10:44:48 +0900 Subject: [PATCH] limit type to 32 --- freqtrade/data/converter.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/freqtrade/data/converter.py b/freqtrade/data/converter.py index 531a69647..03393905d 100644 --- a/freqtrade/data/converter.py +++ b/freqtrade/data/converter.py @@ -136,18 +136,18 @@ def reduce_mem_usage(pair: str, df: DataFrame) -> DataFrame: c_min = df[col].min() c_max = df[col].max() if str(col_type)[:3] == "int": - if c_min > np.iinfo(np.int8).min and c_max < np.iinfo(np.int8).max: - df[col] = df[col].astype(np.int8) - elif c_min > np.iinfo(np.int16).min and c_max < np.iinfo(np.int16).max: - df[col] = df[col].astype(np.int16) - elif c_min > np.iinfo(np.int32).min and c_max < np.iinfo(np.int32).max: + # if c_min > np.iinfo(np.int8).min and c_max < np.iinfo(np.int8).max: + # df[col] = df[col].astype(np.int8) + # elif c_min > np.iinfo(np.int16).min and c_max < np.iinfo(np.int16).max: + # df[col] = df[col].astype(np.int16) + if c_min > np.iinfo(np.int32).min and c_max < np.iinfo(np.int32).max: df[col] = df[col].astype(np.int32) elif c_min > np.iinfo(np.int64).min and c_max < np.iinfo(np.int64).max: df[col] = df[col].astype(np.int64) elif str(col_type)[:5] == "float": - if c_min > np.finfo(np.float16).min and c_max < np.finfo(np.float16).max: - df[col] = df[col].astype(np.float16) - elif c_min > np.finfo(np.float32).min and c_max < np.finfo(np.float32).max: + # if c_min > np.finfo(np.float16).min and c_max < np.finfo(np.float16).max: + # df[col] = df[col].astype(np.float16) + if c_min > np.finfo(np.float32).min and c_max < np.finfo(np.float32).max: df[col] = df[col].astype(np.float32) else: df[col] = df[col].astype(np.float64)