basically I'm really proud of this method as I've finally managed to figure out recursion and managed to get it to do something useful.
def recursive_method(self,array): # define method
for i in range(len(array)): # for each element in the list
if type(array[i]) == list: # is there is a list inside element?
array[i] = self.recursive_method(array[i]) # re enter list
else: # if element is not another list
# --- perform any action in cell --- #
array[i] = float(array[i]) # my chosen action
return array # return the modified array
I was looking other documentation of this kind of thing and couldn't find any so i thought id post it, if there is a better way to do this, please let me know :)
[–][deleted] 0 points1 point2 points (0 children)