Skip to content

Commit

Permalink
ch08 correction
Browse files Browse the repository at this point in the history
  • Loading branch information
zecevicp committed Dec 11, 2015
1 parent 234de3f commit 7c3c430
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ch08/scala/ch08-listings.scala
Expand Up @@ -62,7 +62,8 @@ dfraw.show()

dfraw.groupBy(dfraw("workclass")).count().foreach(println)
//Missing data imputation
val dfrawrpl = dfraw.na.replace(Array("workclass", "occupation"), Map("?" -> "Private"))
val dfrawrp = dfraw.na.replace(Array("workclass"), Map("?" -> "Private"))
val dfrawrpl = dfrawrp.na.replace(Array("occupation"), Map("?" -> "Prof-specialty"))
val dfrawnona = dfrawrpl.na.replace(Array("native_country"), Map("?" -> "United-States"))

//converting strings to numeric values
Expand Down

0 comments on commit 7c3c430

Please sign in to comment.