Skip to content

Instantly share code, notes, and snippets.

@1ambda
Created December 20, 2021 11:47
Show Gist options
  • Save 1ambda/fb1566c70ed291908c8f43f63756bce6 to your computer and use it in GitHub Desktop.
Save 1ambda/fb1566c70ed291908c8f43f63756bce6 to your computer and use it in GitHub Desktop.
case class MarketingUserRefined(userId: Int,
yearBirth: Int,
education: String,
income: Option[Int],
kidhome: Option[Int],
teenhome: Option[Int],
dtCustomer: String,
recency: Option[Int])
val dsUserRefined = dfSelected
.withColumnRenamed("id", "userId")
.as[MarketingUserRefined]
val dsUserFiltered = dsUserRefined.filter(x => x.education == "Master")
dsUserFiltered.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment