From 28550ef3ff86d30d5ff71a6c664fcd15f2221f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 27 Apr 2021 23:51:26 -0400 Subject: [PATCH] Fix approach to dropping column after using it --- pomodoro_to_harvest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 03a03e6..6d895be 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -43,7 +43,7 @@ timelog['description'] = timelog['description'].str.strip() timelog['tmp_multiplier'] = (np.where(timelog['description'].str.contains('\*\s*\d$'), timelog['description'].str.rsplit('*', 1).str[1].str.strip(), 1)) timelog['description'] = (np.where(timelog['description'].str.contains('\*\s*\d$'), timelog['description'].str.rsplit('*', 1).str[0], timelog['description'])) timelog["time"] = timelog["time"] * timelog['tmp_multiplier'].astype(int) -timelog['tmp_multiplier'].drop() +timelog.drop(columns=['tmp_multiplier'], inplace=True) # Clean up description again, after it has been sliced and diced. timelog['description'] = timelog['description'].str.strip()