2021-04-27 13:41:44 +00:00
|
|
|
import pandas as pd
|
|
|
|
# import matplotlib.pyplot as plt
|
|
|
|
|
|
|
|
timelog = pd.read_csv("timelog-titled.csv")
|
|
|
|
|
2021-04-27 15:30:53 +00:00
|
|
|
timelog["started"] = pd.to_datetime(timelog["started"]).dt.tz_convert("US/Eastern")
|
|
|
|
timelog["recorded"] = pd.to_datetime(timelog["recorded"]).dt.tz_convert("US/Eastern")
|
2021-04-27 15:06:20 +00:00
|
|
|
timelog["time"] = 30
|
|
|
|
# A pomodoro started before 3am Eastern time is considered to be a continuation
|
|
|
|
# of the day before, so we are, effectively, on West Coast time for determining
|
|
|
|
# the day we want to associate a time entry with. PomodoroPrompt saves as UTC.
|
|
|
|
timelog["date"] = timelog["started"].dt.tz_convert("US/Pacific").dt.date
|
2021-04-27 15:31:27 +00:00
|
|
|
timelog["day_of_week"] = pd.to_datetime(timelog["date"]).dt.day_name()
|
2021-04-27 15:32:34 +00:00
|
|
|
|
|
|
|
# Condense duplicate entries by date, summing the minutes spent.
|
|
|
|
timelog = timelog.groupby(["date", "description"]).agg({"time": ['sum']})
|