I have a dataframe which consists of a date column but the date column is in string. How can I check if the date lies in first half of the month or the second half and add add another column with the billing date
For e.g.
if the date is 08-10-2020
(format is dd-mm-yyyy) then the billing date
column will consist of 16th of the same month and if the date lies in between 17-31 it then the billing date will consist of 1st day of next month
Data:
print(df['dispatch_date'].head())
0 01-10-2020
1 07-10-2020
2 17-10-2020
3 16-10-2020
4 09-10-2020
Name: dispatch_date, dtype: object
example output:
billing date
0 01-10-2020 16-10-2020
1 07-10-2020 16-10-2020
2 17-10-2020 01-11-2020
3 16-10-2020 01-11-2020
4 09-10-2020 16-10-2020