Created
April 20, 2019 19:29
-
-
Save mikepyts/060866b47ec454c407fc046fbf4ff495 to your computer and use it in GitHub Desktop.
This file contains 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
// Data holders | |
val temperatureData = mutableListOf<Float>() | |
val pressureData = mutableListOf<Float>() | |
val timeData = mutableListOf<Float>() | |
// Convert data from BigQuery JsonTable to data arrays | |
fun processData(tableData: JsonTable) { | |
tableData.rows.forEach { | |
it.f.forEachIndexed { index, element -> | |
when (index) { | |
0 -> temperatureData.add(element.v.toFloat()) | |
1 -> pressureData.add(element.v.toFloat()) | |
2 -> timeData.add(simpleDateFormat.parse(element.v).time.toFloat()) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment