I have a database that looks like this dataframe1:
identifier Start End c1 g1 c2 g2 c3 g3
-----------------------------------------------------------------
24r 7/6/2009 7/27/2009 100 1 120 2 110 3
34e 8/6/2009 8/27/2009 200 5 180 4 190 1
34r 9/26/2009 10/17/2009 150 120 23 140 5
And I would like the output to be dataframe2
Week number week start Week end Identifier cAmount
--------------------------------------------------------
1 7/6/2009 7/13/2009 24r 100
2 7/13/2009 7/20/2009 24r 120
3 7/20/2009 7/27/2009 24r 110
1 8/6/2009 8/13/2009 34e 200
2 8/13/2009 8/20/2009 34e 180
3 8/20/2009 8/27/2009 34e 190
1 9/26/2009 10/3/2009 34r 150
2 10/3/2009 10/10/2009 34r 120
3 10/10/2009 10/17/2009 34r 140
I am asking this because I know this can be done using a forand various nested ifs but I wonder if there is a more efficient way of doing this like with a Pandas. So the idea is in simple terms I have a horizontal dataframe that has a start date and the weeks are not separated in columns. Rather each column has vertical information. So the idea I had is to move Column 1 to 3 close to each other and then do a transpose, but this seems rather inefficient because I have more then 3 columns. If anyone knows a good method for this I would appreciate a lot.
To clarify, Dataframe 1 will be the initial data, and Column Start Will be week 1 of every identifier in dataframe 2 'week start', in dataframe 2 'week end' will be 7 days after week start. 'week start' for week number 2 would be the same as 'week end 1'. Now for cAmount in dataframe 2. The first week value will come from dataframe 1 'c1' second week value will be from dataframe 1 'c2', and week 3 cAmount value will come from 'c3'.
A simple representation :

