I have the following df
with Date
elements being a string
followed by YYYY.MM
:
df =
Date Value
0 name 2019.06 1.0
1 string 2018.03 1.6
2 string 2017.12 1.0
3 string 2016.09 1.7
4 name 2018.09 6.0
...
And I would like to convert the Date
column to the last business day (Monday to Friday) of its month.
So I could get this output:
df =
Date Value
0 2019-06-28 1.0
1 2018-03-30 1.6
2 2017-12-29 1.0
3 2016-09-30 1.7
4 2018-09-28 6.0
...
I tried re.search
to start by searching for the date parts of each element of the column, but I can't figure out the solution for this.