def arrayToTuple(arr): for i in range(len(arr)): try: arr[i] = tuple(arr[i]) except: arr[i] return arr