toDoublefunc = UserDefinedFunction(lambda x: float(x), DoubleType())
changedTypedf = joindf.withColumn('label', toDoublefunc(joindf['show']))
how to change a Dataframe column from String type to Double type in pyspark