ContinuumIO/blaze — pull request #481 by mrocklin (2014-08-18 17:30:20+00:00)
Title: [WIP] - Summary

Introduces new term, `Summary`, which is collection of named reductions

```Python
In [2]: L = [[1, 'Alice', 100],
[2, 'Bob', -200],
[3, 'Charlie', 300],
[4, 'Dennis', 400],
[5, 'Edith', -500]]

In [3]: t = Table(L, columns=['id', 'name', 'amount'])

In [4]: summary(count=t.id.count(), total=t.amount.sum())
Out[4]: (5, 100)

In [5]: print summary(count=t.id.count(), total=t.amount.sum())
Summary(_1, ('count', 'total'), (5, 100))

In [6]: ts = TableSymbol('ts', t.schema)

In [7]: print summary(count=ts.id.count(), total=ts.amount.sum())
Summary(ts, ('count', 'total'), (count(ts['id']), sum(ts['amount'])))
```

This is on the way to implementing the `dplyr` frontend. it also provides, I think, a cleaner abstraction for `By` because it forces users to specify reduction names through keyword arguments.