Method: Utilities::Statistics#frequences
- Defined in:
- lib/utilities/utilities.rb
#frequences ⇒ Object
Calculate the number of occurences for each element of the array
59 60 61 |
# File 'lib/utilities/utilities.rb', line 59 def frequences inject(Hash.new(0)) { |h, v| h[v] += 1; h } end |