ContinuumIO/blaze — pull request #350 by mrocklin (2014-06-23 19:06:52+00:00)
Title: Imports

Sets up sane default imports

```Python
In [1]: from blaze import *
csv =
In [2]: csv = CSV('/home/mrocklin/data/bitcoin/data-code/user_edges.txt',
columns=['transaction', 'sender', 'recipient', 'timestamp', 'value'],
hints={'timestamp': 'datetime'})

In [3]: t = Table(csv)

In [4]: t
Out[4]:
transaction sender recipient timestamp value
0 1 2 2 20130410142250 24.375000
1 1 2 782477 20130410142250 0.770900
2 2 620423 4571210 20111227114312 614.174951
3 2 620423 3 20111227114312 128.040520
4 3 3 782479 20130410142250 47.140520
5 3 3 4 20130410142250 150.000000
6 4 39337 39337 20120617120202 0.310818
7 4 39337 3 20120617120202 69.100000
8 5 2071196 2070358 20130304143805 61.602352
9 5 2071196 5 20130304143805 100.000000

[10 rows x 5 columns]
...
In [7]: from blaze.sql import *

In [8]: sql = SQL('sqlite:///btc.db', 'user_edges')

In [9]: s = Table(sql)

In [10]: s
Out[10]:
transaction sender recipient date value
0 1 2 2 2013-04-10 14:22:50 24.375000
1 1 2 782477 2013-04-10 14:22:50 0.770900
2 2 620423 4571210 2011-12-27 11:43:12 614.174951
3 2 620423 3 2011-12-27 11:43:12 128.040520
4 3 3 782479 2013-04-10 14:22:50 47.140520
5 3 3 4 2013-04-10 14:22:50 150.000000
6 4 39337 39337 2012-06-17 12:02:02 0.310818
7 4 39337 3 2012-06-17 12:02:02 69.100000
8 5 2071196 2070358 2013-03-04 14:38:05 61.602352
9 5 2071196 5 2013-03-04 14:38:05 100.000000

[10 rows x 5 columns]
...
```

TODO: This currently breaks the Spark backend because we can't send any functions down Spark pipes that include anything having to do with Pandas. Because Blaze imports pandas by default no code even remotely related to Blaze code can be serialized.