Next: , Previous: , Up: Usage Examples   [Contents][Index]


5.10 Binning numbers

Bin input values into buckets of size 5:

$ ( echo X ; seq -10 2.5 10 ) \
      | datamash -H --full bin:5 1
    X  bin(X)
-10.0    -15
 -7.5    -10
 -5.0    -10
 -2.5     -5
  0.0      0
  2.5      0
  5.0      5
  7.5      5
 10.0     10