Created
December 6, 2016 03:24
-
-
Save josep2/a87ba0597713f382f01033d99ccb476e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fillMax(values: Vector): DenseVector = { | |
val result: Array = values.copy.toArray | |
val max: Double = result.filter(!_.isNaN).max | |
finalresult = result.map(x => isNan(x)) | |
def isNan(a: Double): Double = a.isNaN match { | |
case true => max | |
case _ => a | |
} | |
new DenseVector(finalResult) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment