How to return NaN if all values are NaN using the agg() function specifying aggregation output columns I have a dataframe like so: