From 439fa86b5c5026fa3db2ef99461e1647d1e4f248 Mon Sep 17 00:00:00 2001 From: Gourav Kumar Date: Sun, 20 Feb 2022 21:51:54 +0530 Subject: [PATCH] ffill and bfill now return TimeSeries objects instead of lists --- fincal/fincal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fincal/fincal.py b/fincal/fincal.py index 8691639..1e3fb34 100644 --- a/fincal/fincal.py +++ b/fincal/fincal.py @@ -75,7 +75,7 @@ class TimeSeries(TimeSeriesCore): self.time_series = new_ts return None - return new_ts + return TimeSeries(new_ts, frequency=self.frequency.symbol) def bfill(self, inplace: bool = False, limit: int = None) -> Union[TimeSeries, None]: """Backward fill missing dates in the time series @@ -109,7 +109,7 @@ class TimeSeries(TimeSeriesCore): self.time_series = new_ts return None - return new_ts + return TimeSeries(new_ts, frequency=self.frequency.symbol) def calculate_returns( self,