From 3319431f253317af0bffe76e6a178de1a57e8fc0 Mon Sep 17 00:00:00 2001 From: rozetko Date: Thu, 14 Jun 2018 16:01:20 +0300 Subject: [PATCH] minor fixes --- analytics/data_provider.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/analytics/data_provider.py b/analytics/data_provider.py index 78f83c6..4cecbd6 100644 --- a/analytics/data_provider.py +++ b/analytics/data_provider.py @@ -52,10 +52,9 @@ class DataProvider: return result dataframe = self.get_dataframe(None) for anomaly in anomalies: - start_time = pd.to_datetime(anomaly['start'] + 1, unit='ms') - finish_time = pd.to_datetime(anomaly['finish'] - 1, unit='ms') - current_index = (dataframe['timestamp'] >= start_time) & ( - dataframe['timestamp'] <= finish_time) + start_time = pd.to_datetime(anomaly['start'] - 1, unit='ms') + finish_time = pd.to_datetime(anomaly['finish'] + 1, unit='ms') + current_index = (dataframe['timestamp'] >= start_time) & (dataframe['timestamp'] <= finish_time) anomaly_frame = dataframe[current_index] if anomaly_frame.empty: continue