Browse Source

Fix issue with start_time > finish_time

pull/1/head
rozetko 7 years ago
parent
commit
d7ef1f67d8
  1. 4
      analytics/pattern_detection_model.py

4
analytics/pattern_detection_model.py

@ -89,8 +89,8 @@ class PatternDetectionModel:
ts1 = int(time_value[0].timestamp() * 1000) ts1 = int(time_value[0].timestamp() * 1000)
ts2 = int(time_value[1].timestamp() * 1000) ts2 = int(time_value[1].timestamp() * 1000)
segments.append({ segments.append({
'start': ts1, 'start': min(ts1, ts2),
'finish': ts2 'finish': max(ts1, ts2)
}) })
last_dataframe_time = dataframe.iloc[- 1]['timestamp'] last_dataframe_time = dataframe.iloc[- 1]['timestamp']

Loading…
Cancel
Save