我有一个列为String的数据框。我想在PySpark中将列类型更改为Double type。
以下是我的方法:
toDoublefunc = UserDefinedFunction(lambda x: x,DoubleType())
changedTypedf = joindf.withColumn("label",toDoublefunc(joindf['show']))
只是想知道,这是正确的方法,就像通过Logistic回归运行时一样,我遇到了一些错误,所以我想知道,这是麻烦的原因。
翻翻过去那场雪
慕田峪9158850
qq_花开花谢_0
随时随地看视频慕课网APP
相关分类