aaahhuuhuhuh why does our simple groupby stop working and why do more complicated ways work worse

This commit is contained in:
benjamin melançon 2021-06-02 08:56:27 -04:00
parent aa05dc5734
commit 3e782f20ee

View file

@ -159,7 +159,8 @@ timelog['project'] = (np.where(timelog['project'].str.contains(': '), timelog['d
# 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.
tl = timelog.groupby(["date", timelog.project.fillna(""), "description"]).agg({"time": 'sum', "started": 'min', "recorded": 'max'}).reset_index()
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()
# 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.