I have a dataframe df:
Item Name Location Jan-Units Feb-Units Mar-Units Jan-Rev Feb-Rev Mar-Rev Jan-Trl Feb-Trl Mar-Trl
123 ABC CA 20 30 40 100 150 200 1.00 1.50 2.00
456 DEF AZ 25 35 45 125 175 225 1.25 1.75 2.25
I need to melt this df multiple times, keep the first 3 columns the same and add a date column based on the first 3 characters of the melted columns. Output should be:
Item Name Location Date Units Rev Trl
123 ABC CA 01/01/2020 20 100 1.00
123 ABC CA 02/01/2020 30 150 1.50
123 ABC CA 03/01/2020 40 200 2.00
456 DEF AZ 01/01/2020 25 125 1.25
456 DEF AZ 02/01/2020 35 175 1.75
456 DEF AZ 03/01/2020 45 225 2.25
(The actual df has all the months for 2020 and hundreds of rows)