我有三种不同的包含图像的PySpark数据。pandas_udf(return_type, PandasUDFType.SCALAR_ITER)
我认为,image.data of ImageSchema是ImageSchema中应用我的主成分分析的唯一有趣的部分,而image.data是要转换为pandas_udf的部分。另外,我认为pandas_udf是PCA的输入。我只是不明
我正在尝试从pandas_udf返回一个特定的结构。它在一个集群上工作,但在另一个集群上失败。我尝试在组上运行udf,这需要返回类型为数据框架。from pyspark.sql.functions import pandas_udfimport numpy as np
from pyspark.sql.typesList(StructField(CarId,IntegerType,true),StructField(Distance,FloatType,true)
import pyspark.sql.types as typdef parse_model(v):Parse_model=pandas_udf(parse_model,typ.ArrayType(typ.StringType(),True))sample_data_df.withColumn('Models