21

5

Consider the following:

```
data={{{3542313600, 175}, {3542918400, 175}}, {{3544128000, 450},
{3544128000, 450}, {3545337600, 450}, {3545942400, 450}, {3546547200, 450}}};
```

whereas the first element of each `{_,_}`

represent a date in absolute time, i.e. `{_,_}`

corresponds to the pattern `{AbsoluteDate_,Value_}`

.

Now I would like to calculate the sum of all `Value_`

when the corresponding `AbsoluteDate_`

is equal, e.g.

`{3545337600, 450}, {3545337600, 450}`

-> `{3545337600, 900}`

.

Do you mind if your list gets sorted? – rm -rf – 2012-04-16T23:28:26.523

No, I don't mind, because I can get the order back to the original one later. – John – 2012-04-16T23:29:29.323

2Looks like there are many ways to skin the cat. – DavidC – 2012-04-17T00:50:44.127

1@David: in

Mathematica?Always. – J. M.'s ennui – 2012-04-17T11:58:39.1503@John moving-target questions are generally discouraged. You should consider posting your update as a new question. – Mr.Wizard – 2012-04-17T21:22:08.390

1

I changed everything back and posted a new question: http://mathematica.stackexchange.com/questions/4379/list-operations-only-when-restrictions-are-fulfilled-part-2

– John – 2012-04-17T21:32:02.840