Consider the following:
start_date = input('Enter starting date in Month-Year format :')
end_date = input('Enter ending date in Month-Year format :')
course = 'English'
if the user enter 01-2022 and 05-2022, the list of input will be the following: ['01-2022','05-2022','English'] I want to have a dataframe that looks like this:
ID | Date | Course |
---|---|---|
1 | Jan-2022 | English |
2 | Feb-2022 | English |
3 | Mar-2022 | English |
4 | Apr-2022 | English |
5 | May-2022 | English |
If a new user provides new input such as ['01-2022','01-2022','Math']
I want to append this to the previous dataframe and have
ID | Date | Course |
---|---|---|
1 | Jan-2022 | English |
2 | Feb-2022 | English |
3 | Mar-2022 | English |
4 | Apr-2022 | English |
5 | May-2022 | English |
6 | Jan-2022 | Math |
First, I tried generating a list of dates based on this date range with:
month_list = pd.date_range('2014-10-10','2016-01-07', freq='MS').strftime("%b-%Y").tolist()
the result was:
['Nov-2014', 'Dec-2014', --- 'Dec-2015', 'Jan-2016']
then wanted to convert this to a list of lists and append the course name before creating the dataframe from the new list.
Any help?