 <p>Try to play with this:</p> <pre><code>object OptIdx { def main(args: Array[String]) { println(get_deltas(tests)) } var tests = List( List(Some(313.062468), Some(27.847252)), List(Some(301.873641), Some(42.884065)), List(Some(332.373186), Some(53.509768))) def findDifference(oldPrice: Option[Double], newPrice: Option[Double]): Option[Double] = { Some((newPrice.get - oldPrice.get) / oldPrice.get) } def get_deltas(data: List[List[Option[Double]]]): List[List[Option[Double]]] = { (for { index &lt;- 0 to 1 } yield { (for { i &lt;- 0 to data.length - 2 } yield { findDifference(data(i)(index), data(i + 1)(index)) }).toList }).toList } } </code></pre> <p>It prints the numbers you want, but two of them are swapped. I'm sure you can figure it out, though.</p>