Хранение разреженной матрицы numpy в HDF5 (PyTables)

У меня возникли проблемы с сохранением numpy csr_matrix с PyTables. Я получаю эту ошибку:

TypeError: objects of type ``csr_matrix`` are not supported in this context, sorry; supported objects are: NumPy array, record or scalar; homogeneous list or tuple, integer, float, complex or string

Мой код:

f = tables.openFile(path,'w')

atom = tables.Atom.from_dtype(self.count_vector.dtype)
ds = f.createCArray(f.root, 'count', atom, self.count_vector.shape)
ds[:] = self.count_vector
f.close()

Есть идеи?

Спасибо

21
задан pnsilva 20 June 2012 в 12:06
поделиться