From e6625c975f023a763063fe3d089988f9021524c3 Mon Sep 17 00:00:00 2001 From: flatberg Date: Mon, 7 Jan 2008 12:44:08 +0000 Subject: [PATCH] bugfix --- fluents/dataset.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fluents/dataset.py b/fluents/dataset.py index 221c0c2..141198f 100644 --- a/fluents/dataset.py +++ b/fluents/dataset.py @@ -581,16 +581,18 @@ def read_ftsv(fd, sep=None): if type == 'category': if sp_format: matrix = sparse.lil_matrix(dim_lengths) - read_elements = _read_sparse_elements else: matrix = empty(dim_lengths, dtype='i') - read_elements = _read_elements elif type == 'network': matrix = empty(dim_lengths) else: matrix = empty(dim_lengths) + + if sp_format: + matrix = _read_sparse_elements(fd, matrix) + else: + matrix = _read_elements(fd, matrix) - matrix = read_elements(fd, matrix, sep) # Create dataset of specified type if type == 'category':