Skip to content

Commit

Permalink
Wrong window size (thanks Jérôme Kieffer)
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameisfiber committed Sep 8, 2014
1 parent 529b52c commit 26be25a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 05_iterators/lazy_data_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def check_anomaly(xxx_todo_changeme):
return False


def rolling_window_grouper(data, window_size=3600):
def rolling_window_grouper(data, window_size):
window = tuple(islice(data, 0, window_size))
while True:
current_datetime = datetime.fromtimestamp(window[0][0])
Expand All @@ -68,7 +68,7 @@ def rolling_window_grouper(data, window_size=3600):

print "Using rolling_window_grouper:"
data = read_fake_data("fake_filename")
data_day = rolling_window_grouper(data)
data_day = rolling_window_grouper(data, window_size=86400)
anomalous_dates = ifilter(None, imap(check_anomaly, data_day))
first_anomalous_date = anomalous_dates.next()
print "The first anomalous date is: ", first_anomalous_date
Expand Down

0 comments on commit 26be25a

Please sign in to comment.