def create_mat(self, list_, row2word=None, col2word=None): if row2word is None: row2word = self.row2word if col2word is None: col2word = self.col2word return IndexMatrix(sp.coo_matrix(list_), row2word, col2word)
def setUp(self): self.spmat = sp.coo_matrix([[2, 5, 3], [0, 1, 9]]) self.row2word = ['a', 'b'] self.col2word = ['furiously', 'makes', 'sense'] self.mat = IndexMatrix(self.spmat, self.row2word, self.col2word)