aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Simon <esimon@esimon.eu>2015-04-29 11:17:41 -0400
committerÉtienne Simon <esimon@esimon.eu>2015-04-29 11:17:41 -0400
commite51b6fdf8b23dc1bb6331c34708a599f55b568f4 (patch)
tree550503a56bb19557017dcc45b7f5bad39eb9315c
parentff0d3a7e7e4d076d95e8aff0dbf2f1ea18473602 (diff)
downloadtaxi-e51b6fdf8b23dc1bb6331c34708a599f55b568f4.tar.gz
taxi-e51b6fdf8b23dc1bb6331c34708a599f55b568f4.zip
Fix hdf5 polyline conversion
-rwxr-xr-xconvert_data.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/convert_data.py b/convert_data.py
index c58de3f..f81b40f 100755
--- a/convert_data.py
+++ b/convert_data.py
@@ -74,9 +74,9 @@ def read_taxis(input_directory, h5file, dataset, prefix):
timestamp[id] = int(line[5])
day_type[id] = ord(line[6][0]) - ord('A')
missing_data[id] = line[7][0] == 'T'
- polyline = numpy.array(ast.literal_eval(line[8]), dtype=theano.config.floatX)
- latitude[id] = polyline[:, 1] if polyline.ndim==2 else polyline
- longitude[id] = polyline[:, 0] if polyline.ndim==2 else polyline
+ 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)
id+=1
splits = {}
print >> sys.stderr, 'read %s: writing' % dataset