I am trying to change the values of an array into smaller numbers like
list = [1,3,7,3]
into
list = [1,2,3,2]
I already have a few lines of code to keep it organized.
def sortItems(list):
counts = collections.Counter(list)
sortedlist = sorted(list, key=counts.get, reverse=True)
return sortedlist
been crawling all over W3Schools and other forums but still unsure
[7, 1, 3, 1]become?