count = counts[type] || [0]
avg = count.inject(0) { |acc, elem| acc + elem } / (1.0 * count.length)
puts "#{type}.value #{avg}"
count = counts[type] || [0]
avg = count.inject(0) { |acc, elem| acc + elem } / (1.0 * count.length)
puts "#{type}.value #{avg}"