In [1]:
import scala.io.Source;

//copied file locally https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data
val filename = "iris.data"
//println("SepalLength, SepalWidth, PetalLength, PetalWidth, Class");

//load iris data into an array
val array = scala.collection.mutable.ArrayBuffer.empty[Float]
for (line <- Source.fromFile(filename).getLines) {
    var cols = line.split(",").map(_.trim);
    //println(s"${cols(0)}|${cols(1)}|${cols(2)}|${cols(3)} |${cols(4)}");
    val i = cols(0).toFloat
    array += i;
}

//get some minimal statistics
val count = array.length;
var min:Double = 9999.0;
var max:Double = 0.0;
var total:Double = 0.0;
for ( x <- array ) {
    if (x < min) { min = x; }
    if (x > max) { max = x; }
    total += x;     
}
val mean:Double = total / count;
Out[1]:
import scala.io.Source;

//copied file locally https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data

filename: String = "iris.data"
array: collection.mutable.ArrayBuffer[Float] = ArrayBuffer(
  5.1F,
  4.9F,
  4.7F,
  4.6F,
  5.0F,
  5.4F,
  4.6F,
  5.0F,
  4.4F,
  4.9F,
  5.4F,
...
count: Int = 150
min: Double = 4.300000190734863
max: Double = 7.900000095367432
total: Double = 876.4999990463257
mean: Double = 5.843333326975505