# 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