mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 02:14:13 +00:00
Fix labels for mlr histogram --auto (#1089)
This commit is contained in:
parent
87faddd661
commit
4a53a6b278
11 changed files with 40 additions and 2 deletions
|
|
@ -367,11 +367,11 @@ func (tr *TransformerHistogram) emitAuto(
|
|||
|
||||
outrec.PutReference(
|
||||
tr.outputPrefix+"bin_lo",
|
||||
mlrval.FromFloat((lo+float64(i))/mul),
|
||||
mlrval.FromFloat(lo+(float64(i)/mul)),
|
||||
)
|
||||
outrec.PutReference(
|
||||
tr.outputPrefix+"bin_hi",
|
||||
mlrval.FromFloat((lo+float64(i+1))/mul),
|
||||
mlrval.FromFloat(lo+(float64(i+1)/mul)),
|
||||
)
|
||||
|
||||
for _, valueFieldName := range tr.valueFieldNames {
|
||||
|
|
|
|||
1
test/cases/verb-histogram/0005/cmd
Normal file
1
test/cases/verb-histogram/0005/cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --icsv --opprint histogram --nbins 9 --auto -f x test/input/histo2.csv
|
||||
0
test/cases/verb-histogram/0005/experr
Normal file
0
test/cases/verb-histogram/0005/experr
Normal file
10
test/cases/verb-histogram/0005/expout
Normal file
10
test/cases/verb-histogram/0005/expout
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
bin_lo bin_hi x_count
|
||||
100.00000000 122.22222222 1
|
||||
122.22222222 144.44444444 0
|
||||
144.44444444 166.66666667 0
|
||||
166.66666667 188.88888889 0
|
||||
188.88888889 211.11111111 2
|
||||
211.11111111 233.33333333 0
|
||||
233.33333333 255.55555556 0
|
||||
255.55555556 277.77777778 0
|
||||
277.77777778 300.00000000 1
|
||||
1
test/cases/verb-histogram/0006/cmd
Normal file
1
test/cases/verb-histogram/0006/cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --icsv --opprint histogram --nbins 9 --auto -f y test/input/histo2.csv
|
||||
0
test/cases/verb-histogram/0006/experr
Normal file
0
test/cases/verb-histogram/0006/experr
Normal file
10
test/cases/verb-histogram/0006/expout
Normal file
10
test/cases/verb-histogram/0006/expout
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
bin_lo bin_hi y_count
|
||||
20.00000000 26.66666667 1
|
||||
26.66666667 33.33333333 0
|
||||
33.33333333 40.00000000 0
|
||||
40.00000000 46.66666667 2
|
||||
46.66666667 53.33333333 0
|
||||
53.33333333 60.00000000 0
|
||||
60.00000000 66.66666667 0
|
||||
66.66666667 73.33333333 0
|
||||
73.33333333 80.00000000 1
|
||||
1
test/cases/verb-histogram/0007/cmd
Normal file
1
test/cases/verb-histogram/0007/cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --icsv --opprint histogram --nbins 9 --auto -f x,y test/input/histo2.csv
|
||||
0
test/cases/verb-histogram/0007/experr
Normal file
0
test/cases/verb-histogram/0007/experr
Normal file
10
test/cases/verb-histogram/0007/expout
Normal file
10
test/cases/verb-histogram/0007/expout
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
bin_lo bin_hi x_count y_count
|
||||
20.00000000 51.11111111 0 3
|
||||
51.11111111 82.22222222 0 1
|
||||
82.22222222 113.33333333 1 0
|
||||
113.33333333 144.44444444 0 0
|
||||
144.44444444 175.55555556 0 0
|
||||
175.55555556 206.66666667 2 0
|
||||
206.66666667 237.77777778 0 0
|
||||
237.77777778 268.88888889 0 0
|
||||
268.88888889 300.00000000 1 0
|
||||
5
test/input/histo2.csv
Normal file
5
test/input/histo2.csv
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
x,y
|
||||
100,20
|
||||
200,40
|
||||
300,41
|
||||
200,80
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue