Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. toDoublefunc = UserDefinedFunction(lambda x: x,DoubleType())
  2. changedTypedf = joindf.withColumn("label",toDoublefunc(joindf['show']))
  3.  
  4. changedTypedf = joindf.withColumn("show", joindf["show"].cast(DoubleType()))
  5.  
  6. toDoublefunc = UserDefinedFunction(lambda x: float(x),DoubleType())
  7. changedTypedf = joindf.withColumn("label",toDoublefunc(joindf['show']))
  8.  
  9. { "x": 12, "y": { "p": { "name": "abc", "value": "10" }, "q":{"name":"xyz",
  10. "val":"99"} } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement