Skip to content

Instantly share code, notes, and snippets.

@shubham0204
Created April 24, 2021 08:12
Show Gist options
  • Save shubham0204/70fd2524d322c7b555d4a91f95ab5923 to your computer and use it in GitHub Desktop.
Save shubham0204/70fd2524d322c7b555d4a91f95ab5923 to your computer and use it in GitHub Desktop.
// Convert the given String[] to a Float[]
// Note: The `CSVReader` returns a row as String[] where each String is a number. We parse this String and convert it to
// a float.
fun convertStringArrayToFloatArray( strArray : Array<String> ) : FloatArray {
val out = strArray.map { si -> si.toFloat() }.toFloatArray()
return out
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment