I have been searching everywhere in Google, trying to figure out if there is a built-in function that you can find the mode of a list of the number in other words the most consist number appeared in list. I have created a random generator list from range 1 to 100.
[Help] Finding the mode
Page 1 of 17 Replies - 652 Views - Last Post: 10 December 2012 - 08:52 AM
Replies To: [Help] Finding the mode
#2
Re: [Help] Finding the mode
Posted 10 December 2012 - 01:58 AM
The most consist number?
Do you mean the number that appears the most number of times in the list?
Do you mean the number that appears the most number of times in the list?
#3
Re: [Help] Finding the mode
Posted 10 December 2012 - 02:03 AM
Yes, I think he means that...I believe the word he was trying to use was 'consistent' 
regards,
Raghav
regards,
Raghav
#4
Re: [Help] Finding the mode
Posted 10 December 2012 - 02:04 AM
You could look into a dictionary: your keys would be numbers and values would be the number of time they appear in the list.
Then, you take a key with the highest value.
Or you can create a simple class with 2 instance variables that will do the same as mentioned above.
Then, you take a key with the highest value.
Or you can create a simple class with 2 instance variables that will do the same as mentioned above.
#5
Re: [Help] Finding the mode
Posted 10 December 2012 - 03:14 AM
Yes, I mean the most consistent value in the list, although in math terminology is usually called mode. And @darek9576, how to use dictionary?
#6
Re: [Help] Finding the mode
Posted 10 December 2012 - 03:16 AM
There are ton of resources about dictionaries on the internet.
Page 1 of 1

New Topic/Question
Reply


MultiQuote





|