I'm trying to normilise the second item in the below list to 1. I can do this if the list only has numbers in a single list as follows
rank = [['a', 234],['b',435],['c',567]]
ranking = [float(i)/sum(rank) for i in rank]
However when the list has a second item and is nested this fails with
ranking = [float(i[1])/sum(rank) for i[1] in rank]