This is the code I have so far to take the row-wise average of selected columns.
val df2 = df1.select(num_columns.ma