3 ms·
Stats also works fine with pure []float64 data. The types allow for a very clean API for working with data and statistics. You can compare using functions[1] or
by anonfunction 11y ago
Stats also works fine with pure []float64 data. The types allow for a very clean API for working with data and statistics. You can compare using functions[1] or methods[2] in /examples.
I started with only []float64 but wanted to allow stuff like this:
func getData() []float64 {
// Do stuff to get the data and
// store it in var data []float64
return data
}
var d Float64Data = getData()
fmt.Println(d.Max())
1. https://github.com/montanaflynn/stats/blob/master/examples/main.go https://github.com/montanaflynn/stats/blob/master/examples/m...
2. https://github.com/montanaflynn/stats/blob/master/examples/methods.go https://github.com/montanaflynn/stats/blob/master/examples/m...