From 8cb00bf08622f30f5ec92fc3abf3043285c04161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Melan=C3=A7on?= Date: Sun, 12 Dec 2021 15:44:19 -0500 Subject: [PATCH] OK wow lot harder to remove value from column than expected --- pomodoro_to_harvest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 6363c7f..1dd322b 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -105,6 +105,9 @@ for days, phrases in timeshift_days.items(): timelog.loc[timelog.tmp_timeshift.str.lower().isin(phrases), "tmp_daysdelta"] = int(days) timelog['tmp_daysdelta'] = timelog['tmp_daysdelta'].fillna(0) timelog['date'] = timelog['date'] + pd.to_timedelta(timelog['tmp_daysdelta'], unit='D') +timelog.tmp_timeshift = '(' + timelog.tmp_timeshift + ')' +# timelog['description'] = (np.where(timelog['tmp_daysdelta'] > 0.0, timelog['description'].str.replace(timelog['tmp_timeshift'], ""), timelog['description'])) +timelog.description.replace(regex=r'(?i)' + timelog.tmp_timeshift, value="") # If a multiplier has been provided (an asterisk and an integer at the end of a # task), then multiply the time by it and remove it from the description.