From 8bdd8922cbf573807b476e13c5e7ba3bc7b983b6 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 24 Feb 2022 00:00:52 +0530 Subject: [PATCH] added items() to TimeSeriesCore --- fincal/core.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fincal/core.py b/fincal/core.py index ba7a2d6..fd9fbfd 100644 --- a/fincal/core.py +++ b/fincal/core.py @@ -98,7 +98,7 @@ def _preprocess_match_options(as_on_match: str, prior_match: str, closest: str) def _parse_date(date: str, date_format: str = None): """Parses date and handles errors""" - + print("Printing the dates", date, type(date)) if isinstance(date, (datetime.datetime, datetime.date)): return datetime.datetime.fromordinal(date.toordinal()) @@ -167,7 +167,7 @@ class Series(UserList): self.data = data def __repr__(self): - return f"{self.__class__.__name__}({self.data}, data_type='{self.data_type.__name__}')" + return f"{self.__class__.__name__}({self.data}, data_type='{self.dtype.__name__}')" def __getitem__(self, i): if isinstance(i, slice): @@ -403,6 +403,9 @@ class TimeSeriesCore(UserDict): result = [(key, self.data[key]) for key in keys] return result + def items(self): + return self.data.items() + @property def iloc(self): """Returns an item or a set of items based on index"""