I have a list that contains date and the list looks like as follow:
list = ['2020-04-05',
'2020-04-12',
'2020-04-19',
'2020-04-26',
'2020-05-03',
'2020-05-10',
'2020-05-17',
'2020-05-24',
'2020-05-31',
'2020-06-07',
'2020-06-14',
'2020-06-21',
'2020-06-28',
'2020-07-05',
'2020-07-12',
'2020-07-19',
'2020-07-26',
'2020-08-02',
'2020-08-09',
'2020-08-16',
'2020-08-23',
'2020-08-30',
'2020-09-06',
'2020-09-20',
'2020-09-13']
I want to extract the highest date of each month from the list. My desired output looks like as follow:
Desired list = ['2020-04-26','2020-05-31','2020-06-28','2020-07-26','2020-08-30','2020-09-20']
I tried to find the max date of the month using Max()
but it gave overall max date from the list. Is there any way of finding max date of each month from the list.