Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- toDoublefunc = UserDefinedFunction(lambda x: x,DoubleType())
- changedTypedf = joindf.withColumn("label",toDoublefunc(joindf['show']))
- changedTypedf = joindf.withColumn("show", joindf["show"].cast(DoubleType()))
- toDoublefunc = UserDefinedFunction(lambda x: float(x),DoubleType())
- changedTypedf = joindf.withColumn("label",toDoublefunc(joindf['show']))
- { "x": 12, "y": { "p": { "name": "abc", "value": "10" }, "q":{"name":"xyz",
- "val":"99"} } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement