Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Finding the frequency of each number in a string

Hi, I have a string of numbers like s=[(11,23),(33,47),(98,20),...,(34,65)] produced by a code in Jupyter. The biggest number is 100. How can I order the numbers based on their frequency of repetition in s? For example for a simple case like s1=[(1,4),(2,4),(4,1)] the result is

Number 4 frequency 3 Number 1 frequency 2 number 2 frequency 1