aboutsummaryrefslogtreecommitdiff
path: root/data/csv_to_hdf5.py
diff options
context:
space:
mode:
authorÉtienne Simon <esimon@esimon.eu>2015-05-06 11:54:52 -0400
committerÉtienne Simon <esimon@esimon.eu>2015-05-06 11:55:26 -0400
commit0b4b65cb3d88ac4818e71ccef0bded3ddee0683c (patch)
tree75c0942dd20e73a6c4a67ab207e916f83c7d4bae /data/csv_to_hdf5.py
parent35b4503ddd148b0c937468891dd0a7e9ff1c79f4 (diff)
downloadtaxi-0b4b65cb3d88ac4818e71ccef0bded3ddee0683c.tar.gz
taxi-0b4b65cb3d88ac4818e71ccef0bded3ddee0683c.zip
Fix floatX!=float32 in hdf5 creation
Diffstat (limited to 'data/csv_to_hdf5.py')
-rwxr-xr-xdata/csv_to_hdf5.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/data/csv_to_hdf5.py b/data/csv_to_hdf5.py
index 17217f3..97cf428 100755
--- a/data/csv_to_hdf5.py
+++ b/data/csv_to_hdf5.py
@@ -7,7 +7,6 @@ import sys
import h5py
import numpy
-import theano
from fuel.converters.base import fill_hdf5_file
import data
@@ -32,8 +31,8 @@ def get_unique_origin_call(val):
def read_stands(input_directory, h5file):
stands_name = numpy.empty(shape=(data.stands_size,), dtype=('a', 24))
- stands_latitude = numpy.empty(shape=(data.stands_size,), dtype=theano.config.floatX)
- stands_longitude = numpy.empty(shape=(data.stands_size,), dtype=theano.config.floatX)
+ stands_latitude = numpy.empty(shape=(data.stands_size,), dtype=numpy.float32)
+ stands_longitude = numpy.empty(shape=(data.stands_size,), dtype=numpy.float32)
stands_name[0] = 'None'
stands_latitude[0] = stands_longitude[0] = 0
with open(os.path.join(input_directory, 'metaData_taxistandsID_name_GPSlocation.csv'), 'r') as f:
@@ -77,8 +76,8 @@ def read_taxis(input_directory, h5file, dataset):
day_type[id] = ord(line[6][0]) - ord('A')
missing_data[id] = line[7][0] == 'T'
polyline = ast.literal_eval(line[8])
- latitude[id] = numpy.array([point[1] for point in polyline], dtype=theano.config.floatX)
- longitude[id] = numpy.array([point[0] for point in polyline], dtype=theano.config.floatX)
+ latitude[id] = numpy.array([point[1] for point in polyline], dtype=numpy.float32)
+ longitude[id] = numpy.array([point[0] for point in polyline], dtype=numpy.float32)
id+=1
splits = ()
print >> sys.stderr, 'read %s: writing' % dataset