I have a dataframe
of one column only. I would like to split the string using the pandas_udf
in pyspark
. Hence, I have the following code:
from pyspark.sql.functions import pandas_udf, PandasUDFType
@pandas_udf('str')
def split_msg(string):
msg_ = string.split(" ")
return msg_
temp = temp.select("_c6").withColumn("decoded",
split_msg(temp._c6)).drop("_c6")
But this is not working.
any help is much appreciated!!