From dc9a9fc96ddd372ad613eb45ac4184f2d8a7e090 Mon Sep 17 00:00:00 2001 From: Thommy257 Date: Thu, 21 May 2020 13:43:46 +0200 Subject: [PATCH] add get_dates() method --- camels/data.py | 6 ++++++ camels/pytorch.py | 3 +++ 2 files changed, 9 insertions(+) diff --git a/camels/data.py b/camels/data.py index 0efa1ac..02a1f62 100644 --- a/camels/data.py +++ b/camels/data.py @@ -314,6 +314,12 @@ def plot_overview(self, start, end): plt.tight_layout() plt.show() + def get_dates(self): + start = self.data.index[0] - timedelta(1) + end = self.data.index[-1] + timedelta(1) + + return start, end + class DataLoader: """ General DataLoader object providing access to batched sequences of diff --git a/camels/pytorch.py b/camels/pytorch.py index 4f85d7e..02601aa 100644 --- a/camels/pytorch.py +++ b/camels/pytorch.py @@ -84,3 +84,6 @@ def data_loader(self, return DataLoader(self, batch_size, shuffle=shuffle) + + def get_dates(self): + return super().get_dates() \ No newline at end of file