Update description successfully to remove shifted time values
Fixes this error: ValueError: Series.replace cannot use dict-like to_replace and non-None value
This commit is contained in:
parent
8cb00bf086
commit
3b90dc2e3e
1 changed files with 2 additions and 1 deletions
|
@ -107,7 +107,8 @@ timelog['tmp_daysdelta'] = timelog['tmp_daysdelta'].fillna(0)
|
||||||
timelog['date'] = timelog['date'] + pd.to_timedelta(timelog['tmp_daysdelta'], unit='D')
|
timelog['date'] = timelog['date'] + pd.to_timedelta(timelog['tmp_daysdelta'], unit='D')
|
||||||
timelog.tmp_timeshift = '(' + timelog.tmp_timeshift + ')'
|
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'] = (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="")
|
# timelog.description.replace(regex=r'(?i)' + timelog.tmp_timeshift, value="")
|
||||||
|
timelog['description'] = timelog.apply(lambda x: x['description'].replace(x['tmp_timeshift']), axis=1)
|
||||||
|
|
||||||
# If a multiplier has been provided (an asterisk and an integer at the end of a
|
# 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.
|
# task), then multiply the time by it and remove it from the description.
|
||||||
|
|
Loading…
Reference in a new issue