From 06619b198a7f95c1cd9bb4b45a6331176ad5577a Mon Sep 17 00:00:00 2001 From: Dominique de Graaff Date: Thu, 15 Feb 2024 17:14:01 +0100 Subject: [PATCH] Update abstract.py: Set default dtype for Series instantiation Following Pandas advice on this warning message: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning. --- lightweight_charts/abstract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightweight_charts/abstract.py b/lightweight_charts/abstract.py index 35a7a75..2b21d2c 100644 --- a/lightweight_charts/abstract.py +++ b/lightweight_charts/abstract.py @@ -659,7 +659,7 @@ class Candlestick(SeriesCommon): f'Trying to update tick of time "{pd.to_datetime(series["time"])}", ' f'which occurs before the last bar time of ' f'"{pd.to_datetime(self._last_bar["time"])}".') - bar = pd.Series() + bar = pd.Series(dtype='float64') if series['time'] == self._last_bar['time']: bar = self._last_bar bar['high'] = max(self._last_bar['high'], series['price'])