Skip to content

Commit

Permalink
Fix #1146 (#1157)
Browse files Browse the repository at this point in the history
* Fix #1146

* added a doc link

* update unit-test case
  • Loading branch information
johnkerl committed Dec 29, 2022
1 parent 5862a9c commit a55e78c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ key-value-pair data in a variety of data formats.
# Getting started

* [Miller in 10 minutes](https://miller.readthedocs.io/en/latest/10min)
* [A Guide To Command-Line Data Manipulation](https://www.smashingmagazine.com/2022/12/guide-command-line-data-manipulation-cli-miller)
* [A quick tutorial on Miller](https://www.ict4g.net/adolfo/notes/data-analysis/miller-quick-tutorial.html)
* [Tools to manipulate CSV files from the Command Line](https://www.ict4g.net/adolfo/notes/data-analysis/tools-to-manipulate-csv.html)
* [www.togaware.com/linux/survivor/CSV_Files.html](https://www.togaware.com/linux/survivor/CSV_Files.html)
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/transformers/histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,11 @@ func (tr *TransformerHistogram) emitNonAuto(

outrec.PutReference(
tr.outputPrefix+"bin_lo",
mlrval.FromFloat((tr.lo+float64(i))/tr.mul),
mlrval.FromFloat(tr.lo+float64(i)/tr.mul),
)
outrec.PutReference(
tr.outputPrefix+"bin_hi",
mlrval.FromFloat((tr.lo+float64(i+1))/tr.mul),
mlrval.FromFloat(tr.lo+float64(i+1)/tr.mul),
)

for _, valueFieldName := range tr.valueFieldNames {
Expand Down
2 changes: 1 addition & 1 deletion test/cases/verb-histogram/0002/cmd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mlr --opprint histogram -f x,y --lo 0 --hi 1 --nbins 20 -o foo_ test/input/small
mlr --opprint histogram -f x,y --lo 0.1 --hi 0.9 --nbins 20 -o foo_ test/input/small
40 changes: 20 additions & 20 deletions test/cases/verb-histogram/0002/expout
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
foo_bin_lo foo_bin_hi foo_x_count foo_y_count
0.00000000 0.05000000 1 0
0.05000000 0.10000000 0 0
0.10000000 0.15000000 0 1
0.15000000 0.20000000 0 1
0.20000000 0.25000000 1 0
0.25000000 0.30000000 0 0
0.30000000 0.35000000 1 1
0.35000000 0.40000000 1 0
0.40000000 0.45000000 0 0
0.45000000 0.50000000 0 1
0.50000000 0.55000000 2 1
0.55000000 0.60000000 2 0
0.60000000 0.65000000 1 0
0.65000000 0.70000000 0 0
0.70000000 0.75000000 0 2
0.75000000 0.80000000 1 0
0.80000000 0.85000000 0 0
0.85000000 0.90000000 0 1
0.90000000 0.95000000 0 0
0.95000000 1.00000000 0 2
0.10000000 0.14000000 0 1
0.14000000 0.18000000 0 0
0.18000000 0.22000000 1 1
0.22000000 0.26000000 0 0
0.26000000 0.30000000 0 0
0.30000000 0.34000000 0 1
0.34000000 0.38000000 1 0
0.38000000 0.42000000 1 0
0.42000000 0.46000000 0 0
0.46000000 0.50000000 0 1
0.50000000 0.54000000 2 1
0.54000000 0.58000000 1 0
0.58000000 0.62000000 2 0
0.62000000 0.66000000 0 0
0.66000000 0.70000000 0 0
0.70000000 0.74000000 0 1
0.74000000 0.78000000 1 1
0.78000000 0.82000000 0 0
0.82000000 0.86000000 0 0
0.86000000 0.90000000 0 1

0 comments on commit a55e78c

Please sign in to comment.