(Dec-02-2022, 04:00 PM)astral_travel Wrote: suppose i want to order the output so the order of the numbers will be by their prevalence...and not by the numeric order as it is at the moment...Don't call dict on the Counter,use the most_common method of Counter.
>>> count = Counter(a) # All >>> count.most_common() .... # 5 most common >>> count.most_common(5) [(58, 17), (11, 16), (99, 16), (13, 15), (63, 15)] >>> count.most_common(1) [(58, 17)]So 58 was the most common number in this run bye the count of 17.
Edit:
posted at same tiime as previous poster.