syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me

Question:
In H2O Sparkling-Water how to change names of DataFrame columns?

I got this question answered at a Meetup:
// Rename columns and remove all spaces in header
val colNames = bikesDF.names().map( n => n.replace(' ', '_'))
bikesDF._names = colNames
bikesDF.update(null) // Update Frame in DKV
// Do not forget to update frame in K/V store !
The above syntax is also on github:

https://github.com/h2oai/sparkling-water/blob/master/examples/scripts/Meetup20150226.script.scala

syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me