Mode function, input and display - Credit: Serge Ballif

A list is entered as an input. The graph calculates the mode(s) which are then passed to the note to be displayed

Is there a new function to compute mode? I couldn’t copy and edit your activity to examine the CL because it says it contains a deprecated feature.

No baked in mode function yet. The tricky part with mode is that there may be more than one, in which case should we change it from a number to a list? take the highest value?

FWIW you can make a mode function on your own now (that’ll match your specs). This one always reports mode as a list, even when there’s only one:

1 Like

I guess really the value(s) of the mode(s) isn’t specifically what I was looking for, but the count / number of times the most common number in a list appears. Specifically, I’m looking to set the bounds of a dotplot created from aggregated student inputs by using the count of the number that appears most often (and adding some space to that).

Got it. m_ost (line 7) is the highest frequency.

1 Like

That’s perfect! I think it was line 5 but it did exactly what I needed! Thanks!

Thanks @Jay, that is just what I was looking for! In terms of building it in, I don’t see any problem in saying the result is always a list. I suppose a separate function, say mode1, could provide the first number in the list but can’t believe there would be much demand for it. Perhaps I’m wrong?

If you want to access the first element of any list, L, just use L[1]

…with “L.elementAt(1)” used outside a graph. Yes, I’m agreeing it is straightforward, so a mode function returning a number list is probably not an issue.