Dataset 1 Age Price Location 20 56000 ABC 30 58999 XYZ Dataset 2 (Array in dataframe) Numeric_attributes [Age, Price] output Mean(Age) Mean(Price)
def minimum_value(df2): min_value = lambda x: x.min() for a in df2.collect(): for b in a.collect(): min_udf = F.udf(lambda row: [min_value(x) for x in b]) df2.withColumn('minimum_value', min_udf(F.col('Numerical_attributes').cast("array<int>"))) return df2
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)