That this answer to Convert numpy ndarray to tuple of tuples in optimize method doens't offer anything more than tuple(tuple(i) for i in a[:,0,:]) suggests this doesn't exist, but I am looking for something like a .totuple() method similar to numpy's .tolist() in that you don't need to know the number of dimensions beforehand to generate a tuple of tuples of tuples...
For my needs this would apply to a float or integer numerical array only.
tolistsis sufficient, and faster than any iteration on an array. It also takes the conversion all the way down, producing python end values (i.e.intinstead ofnp.int64)..tolist()work for me. If there's nototupple()there must be some reason for that. Is there a PEP for I Do Not Want What I Haven't Got? :-)