From 7712fbcee4bd7c5208ba150f786ac0e585b7c8b6 Mon Sep 17 00:00:00 2001 From: Young Date: Mon, 2 Nov 2020 08:53:22 +0000 Subject: [PATCH] fix the float conversion bug --- qlib/data/data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qlib/data/data.py b/qlib/data/data.py index dc2c5886cc..b630834ef8 100644 --- a/qlib/data/data.py +++ b/qlib/data/data.py @@ -671,7 +671,8 @@ def expression(self, instrument, field, start_time=None, end_time=None, freq="da # Ensure that each column type is consistent # FIXME: The stock data is currently float. If there is other types of data, this part needs to be re-implemented. try: - series = series.astype(float) + # TODO: the default storage and calculation type should be configurable + series = series.astype(np.float32) except ValueError: pass if not series.empty: