Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to convert a sage 1-row matrix into tuple ?

import numpy as np

a=random_matrix(ZZ,1,5)

tuple(np.array(a).tolist()[0])

is there something more native ?

motivation: sagematrix,it seems, are not "hashable" and cannot be used as keys in lists to do groupby/countby