PyTables로 numpy csr_matrix를 저장하는 데 문제가 있습니다. 이 오류를 받고 있어요 :HDF5 (PyTables)에 numpy 스파 스 매트릭스 저장
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()
어떤 아이디어가?
감사
디스크의 데이터 크기가 걱정 되십니까? hdf5 파일을 압축 된 형식으로 저장할 수 있다고 생각합니다.이 경우 밀도가 높은 행렬 만 저장하면됩니다. – user545424
http://stackoverflow.com/questions/8895120/using-pytables-which-is-more-efficient-scipy-sparse-or-numpy-dense-matrix, 스파 스 매트릭스에 대한 pytables 지원이없는 것처럼 보입니다. – user545424