This is an effort to learn statistics with golang and create more optimized maths functions than python for learning data science. I dedicate this package to my GrandMother Smt. Gomathi Devi Jat.
- Sample code to calculate mean
package main
import (
"fmt"
"github.com/miteshbsjat/gomathi"
)
func main() {
fmt.Printf("Mean = %f\n", gomathi.Mean([]int{1, 2, 3, 4}))
fmt.Printf("Median = %f\n", gomathi.Median([]int{1, 2, 2, 3, 4}))
}
- Output
$ go run statistics.go
Mean = 2.500000
Median = 2.000000
- Please run the following command to test this package
$ go test