Provide first started and last recorded times for each task

This commit is contained in:
benjamin melançon 2021-04-27 19:48:46 -04:00
parent a42dd0b5e2
commit afbb5dbe1e

View file

@ -12,5 +12,6 @@ timelog["time"] = 30
timelog["date"] = timelog["started"].dt.tz_convert("US/Pacific").dt.date timelog["date"] = timelog["started"].dt.tz_convert("US/Pacific").dt.date
timelog["day_of_week"] = pd.to_datetime(timelog["date"]).dt.day_name() timelog["day_of_week"] = pd.to_datetime(timelog["date"]).dt.day_name()
# Condense duplicate entries by date, summing the minutes spent. # Condense duplicate entries by date, summing the minutes spent, and listing
tl = timelog.groupby(["date", "description"]).agg({"time": ['sum']}, {"started": ['max']}).reset_index() # the first started and last recorded times for each task.
tl = timelog.groupby(["date", "description"]).agg({"time": 'sum', "started": 'min', "recorded": 'max'}).reset_index()