Hi I have data as follows in a spreadsheet
|aaa-date |aaa-val|bbb-date |bbb-val|ccc-date |ccc-val|
|----------|-------|----------|-------|----------|-------|
|08-04-2008|-20.943|31-03-2008|-23.869|26-03-2008|+1.401 |
|09-04-2008|-20.943|01-04-2008|-19.813|27-03-2008|+1.376 |
|10-04-2008|-18.868|02-04-2008|-18.929|28-03-2008|-0.534 |
|11-04-2008|-19.057|03-04-2008|-19.917|31-03-2008|+0.688 |
|14-04-2008|-20.000|04-04-2008|-20.125|01-04-2008|+3.336 |
|15-04-2008|-18.868|07-04-2008|-21.321|02-04-2008|+3.413 |
|16-04-2008|-16.226|08-04-2008|-22.517|03-04-2008|+4.177 |
|17-04-2008|-14.340|09-04-2008|-24.857|04-04-2008|+4.279 |
|18-04-2008|-12.830|10-04-2008|-24.701|07-04-2008|+2.445 |
|21-04-2008|-15.472|11-04-2008|-24.857|08-04-2008|+1.146 |
I want to import this (csv or xlsx) and arrive at a data frame that has only a single date index and columns of aaa-val, bbb-val and ccc-val e.g.
| |aaa-val|bbb-val|ccc-val|
|----------|-------|-------|-------|
|26-03-2008| | |+1.401 |
|27-03-2008| | |+1.376 |
|28-03-2008| | |-0.534 |
|31-03-2008| |-23.869|+0.688 |
|01-04-2008| |-19.813|+3.336 |
|02-04-2008| |-18.929|+3.413 |
|03-04-2008| |-19.917|+4.177 |
|04-04-2008| |-20.125|+4.279 |
|07-04-2008| |-21.321|+2.445 |
|08-04-2008|-20.943|-22.517|+1.146 |
|09-04-2008|-20.943|-24.857|+0.917 |
|10-04-2008|-18.868|-24.701|+2.420 |
|11-04-2008|-19.057|-24.857|+1.860 |
|14-04-2008|-20.000|-26.053|+3.515 |
|15-04-2008|-18.868|-24.805| |
|16-04-2008|-16.226|-23.557| |
|17-04-2008|-14.340|-23.765| |
|18-04-2008|-12.830| | |
|21-04-2008|-15.472| | |
|22-04-2008|-16.793| | |
|23-04-2008|-13.019| | |
|24-04-2008|-12.453| | |
|25-04-2008|-12.642| | |
Is there a smart way to do this other than loading into a temp frame and then looping through date/value column pairs?
thanks