Post Reply 
Can the name of the MODE function be changed? (Statistics)
10-31-2017, 11:39 PM (This post was last modified: 11-01-2017 05:18 PM by StephenG1CMZ.)
Post: #5
RE: Can the name of the MODE function be changed? (Statistics)
Wow.

It's amazing what a couple of lines can accomplish when you are familiar with HP Prime built-in functions.

However, I think there is a bug:
{1,2} yields {1,2,0} rather than the expected {1,2}.

Your version doesn't handle {"red","green","red} - but then it is likely much faster as well as more concise.

My own version is mainly written in the style of a C or Pascal program trawling through the lists, with very limited use of built-in functions such as union (thanks for your #21 solution). As such it is likely slower, but perhaps more portable.

It is included in my new list processing API
http://www.hpmuseum.org/forum/thread-9411.html
But I could extract the relevant procedures here if you like.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Can the name of the MODE function be changed? (Statistics) - StephenG1CMZ - 10-31-2017 11:39 PM



User(s) browsing this thread: 1 Guest(s)