import Numeric._
import grizzled.math.stats._
val l = List[Double](123.0, 133.0, 155.0, 166.0, 177.0)
println(median(l))
Above you see an example which describes the usage of the package grizzled.math.stats
at scala grizzled doc . I am not able to reproduce this simple example.
I always get following errors:
Any suggestion to resolve this compilation error is welcome. Thank you in advance.
median
expects a var-arg argument. You could expand the list with _*
syntax, like this:
import Numeric._
import grizzled.math.stats._
val l = List[Double](123.0, 133.0, 155.0, 166.0, 177.0)
println(median(l: _*))
This compiles and outputs 155.0.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.