Document code

This commit is contained in:
benjamin melançon 2021-04-27 22:30:07 -04:00
parent f51acf4fec
commit 3921d6774f

View file

@ -13,6 +13,8 @@ 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()
# If a project has been specified (task prefixed with a colon), then put the
# project in its own column.
timelog['project'] = (np.where(timelog['description'].str.contains(': '), timelog['description'].str.split(': ', 1).str[0], None)) timelog['project'] = (np.where(timelog['description'].str.contains(': '), timelog['description'].str.split(': ', 1).str[0], None))
timelog['description'] = (np.where(timelog['description'].str.contains(': '), timelog['description'].str.split(': ', 1).str[1], timelog['description'])) timelog['description'] = (np.where(timelog['description'].str.contains(': '), timelog['description'].str.split(': ', 1).str[1], timelog['description']))