I combine 12 different txt files into a dataframe, which looks like this:
Each file contains a different number of data, and the file name was name with the date, e.g. "Student-Score-2010-10.txt".
Each file represents one month.
How can I add back the date to each row?
id dep score
id511 10 34
id512 10 32
id512 10 34
I need to add back the date to each row
id dep score date
id511 10 34 2010-10
id511 10 34 2010-10
id511 10 34 2010-10
id511 10 34 2010-11
id511 10 34 2010-11
id511 10 34 2010-12
id511 10 34 2011-1
I made up the date. It is not the real data
orignial data
Monthly report"
"University of XXXXX"
"+--------+------+-----+"
"| id | dep | scores |
"+-------+-----+------+
"| id593 | 2 | 233 |