I'm using Blaze (0.6.3) with Anaconda 2.1.0 (on Python 2.7.8). I'm trying to use filters based on dates on Table's rows.
The mock TSV file is the following:
name amount date
foo 100 2001-05-11 08:54:48.063856
bar 1000 0001-01-01 00:00:00.0
baz 10000 1970-01-02 00:00:00.0
The python code is
from blaze import *
from datetime import datetime
data = Table(CSV('mock.tsv'))
data[data.name > 'bar']
data[data.amount > 1000]
data[data.date > datetime(1970,1,1)]
The first two filters are ok, but the third one throws a SyntaxError
.
It all seems to boil down to the following:
lambda (name, amount, date): date > (1970-01-01 00:00:00)
which is syntactically invalid. Somehow, somewhere, datetime(1970,1,1)
was translated to datetime(1970-01-01 00:00:00)
, then the datetime
was forgotten. Blaze itself recognizes the date
column with ?datetime
type, which is what I want, but then it fails in the comparison.
Am I using it the wrong way?