Skip to content

2016-3: Statistics - Mode

Write a function that takes a numeric vector or scalar as its right argument and returns the mode (that is, the most common value) of the array. If more than one number occurs the greatest number of times, return all such numbers.

Examples:

     (your_function) 2 1 4 3 2 5 1 2
2
     (your_function) ⍬   ⍝ should return an empty vector       

     (your_function) 1 2 3 4 1 2
1 2 
your_function ←

Solutions

Video Thumbnail
Click to load video from YouTube. This will enable YouTube tracking. YouTube Privacy Information
YouTube

Chat transcript Code on GitHub