my @lines = "data/620201103081524880_bcs_voltMeasure.txt".IO.lines;
my Bag $v = @lines».split('=')».[3].Bag;

#| 计算频次
#.say for $v.hash.sort: -*.value;

#| 计算频次占比
my $sum = [+] $v.hash.values;
.key ~ " => " ~ (.value / $sum).say for $v.hash.sort: -*.value/$sum;

=output
470.0 => 8008
471.0 => 26
469.0 => 23
360.0 => 12
381.0 => 2
376.0 => 2
412.0 => 2
472.0 => 2
404.0 => 2
492.0 => 2
364.0 => 1
440.0 => 1
388.0 => 1
403.0 => 1
460.0 => 1
468.0 => 1
442.0 => 1
410.0 => 1
417.0 => 1
390.0 => 1
370.0 => 1
384.0 => 1
450.0 => 1
434.0 => 1
393.0 => 1
458.0 => 1
395.0 => 1
408.0 => 1
456.0 => 1
436.0 => 1
414.0 => 1
398.0 => 1
392.0 => 1
475.0 => 1
448.0 => 1
419.0 => 1
455.0 => 1
431.0 => 1
425.0 => 1
453.0 => 1
372.0 => 1
396.0 => 1
379.0 => 1
367.0 => 1
366.0 => 1
437.0 => 1
446.0 => 1
438.0 => 1
464.0 => 1
462.0 => 1
400.0 => 1
466.0 => 1
422.0 => 1
420.0 => 1
424.0 => 1
374.0 => 1
362.0 => 1
444.0 => 1
386.0 => 1
430.0 => 1
452.0 => 1
428.0 => 1
