ContinuumIO/blaze — pull request #290 by mrocklin (2014-05-23 18:15:48+00:00)
Title: Label

Add terms to support relabeling columns. This is particularly relevant when joining a table against itself.

```Python
names = TableSymbol('{first: string, last: string}')

siblings = Join(names.relabel({'first': 'left'}),
names.relabel({'first': 'right'}),
'last')[['left', 'right']]

data = [('Alice', 'Smith'),
('Bob', 'Jones'),
('Charlie', 'Smith')]

assert ('Alice', 'Charlie') in set(compute(siblings, {names: data}))
assert ('Alice', 'Bob') not in set(compute(siblings, {names: data}))
```

Separately we provide a way to name a single column. This is useful when the name is not obvious as in

```Python
(t['euros'] * 1.5 + t['dollars']).label('money')
```