I have a data frame of 4 numerical columns and I have to calculate mean of those columns and store the mean in another column in pyspark.
df["mean"] = df.loc[:,d_cols].apply(np.mean, axis=1) (python pandas)
I have to do the same thing as above but in pyspark.