I am trying to add hh:mm:ss column to a column having format as YYYY\MM\DD hh:mm:ss but getting some error. The exact data is below,
col1 = 1:08:10
col2 = 2019/02/22 08:56:32
i am trying to get col3 as 2019/02/22 10:04:42 by adding col1 to col2.
i am using below code,
col3 = pd.to_timedelta(col2).dt.strftime("%Y/%m/%d %H:%M:%S")) + pd.to_timedelta(col1)
I am getting error as,
KeyError: '/'
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
pandas/_libs/tslibs/timedeltas.pyx in pandas._libs.tslibs.timedeltas.array_to_timedelta64()
pandas/_libs/tslibs/timedeltas.pyx in pandas._libs.tslibs.timedeltas.parse_timedelta_string()
pandas/_libs/tslibs/timedeltas.pyx in pandas._libs.tslibs.timedeltas.timedelta_from_spec()
pandas/_libs/tslibs/timedeltas.pyx in pandas._libs.tslibs.timedeltas.parse_timedelta_unit()
ValueError: invalid unit abbreviation: /
Please help.