Skip to content

Commit

Permalink
Merge pull request #23 from stratosphereips/development
Browse files Browse the repository at this point in the history
Removed hardcoded date, sum only numeric columns
  • Loading branch information
jwackito authored Aug 1, 2023
2 parents 0390167 + 63ee765 commit f259aa3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/aip/models/prioritize.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _add_knowledge(last_knowledge, day):
last_knowledge = pd.concat([last_knowledge, df])
dates_min = last_knowledge.groupby('orig').first_seen.min()
dates_max = last_knowledge.groupby('orig').last_seen.max()
knowledge = last_knowledge.groupby('orig').sum()
knowledge = last_knowledge.groupby('orig').sum(numeric_only=True)
knowledge.loc[:,'first_seen'] = dates_min
knowledge.loc[:,'last_seen'] = dates_max
knowledge.loc[:,'mean_flows'] = knowledge['flows']/knowledge['days_active']
Expand Down Expand Up @@ -116,7 +116,7 @@ def __init__(self, load_until='yesterday'):
self._load_knowledge_until(day)


def build(self, start=date(2020, 7, 4), end=date.today() - timedelta(days=1), force=False):
def build(self, start=date.today() - timedelta(days=2), end=date.today() - timedelta(days=1), force=False):
if path.exists(self.path) and not force:
print('Knowledge exists already. Use force=True to rebuild it')
return
Expand Down

0 comments on commit f259aa3

Please sign in to comment.