From 88504f6881bdd1cd4926b9003088be086a488a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Melan=C3=A7on?= Date: Wed, 2 Jun 2021 10:47:24 -0400 Subject: [PATCH] Restore simple, clean, grouping/aggregation that does in fact work --- pomodoro_to_harvest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index cfdd1e9..41a0269 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -160,8 +160,7 @@ timelog['project'] = (np.where(timelog['project'].str.contains(': '), timelog['p # Condense duplicate entries by date, summing the minutes spent, and listing # the first started and last recorded times for each task. # The fillna is essential or we drop entries with blank ('None') projects. -timelogMI = pd.MultiIndex.from_frame(timelog) -tl = timelogMI.groupby(["date", timelog.subproject.fillna("Development"), timelog.project.fillna(""), "description"]).agg({"time": 'sum', "started": 'min', "recorded": 'max'}).reset_index() +tl = timelog.groupby(["date", timelog.project.fillna(""), timelog.subproject.fillna("Development"), "description"]).agg({"time": 'sum', "started": 'min', "recorded": 'max'}).reset_index() # We're doing the final conversion to Harvest as a separate step because we # want to factor out all of the above non-Harvest-specific logic.