SyntaxFix
Write A Post
Hire A Developer
Questions
Here's a function that'll do it:
def totuple(a): try: return tuple(totuple(i) for i in a) except TypeError: return a
And an example:
>>> array = numpy.array(((2,2),(2,-2))) >>> totuple(array) ((2, 2), (2, -2))