1 // Copyright ©2017 The Gonum Authors. All rights reserved.
2 // Use of this code is governed by a BSD-style
3 // license that can be found in the LICENSE file
13 "gonum.org/v1/gonum/floats"
14 "gonum.org/v1/gonum/stat"
17 func ExampleParseWithNA() {
18 // Calculate the mean of a list of numbers
19 // ignoring missing values.
25 var vals, weights []float64
26 sc := bufio.NewScanner(strings.NewReader(data))
28 v, w, err := floats.ParseWithNA(sc.Text(), "missing")
32 vals = append(vals, v)
33 weights = append(weights, w)
39 fmt.Println(stat.Mean(vals, weights))