QuestionQ100

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

Which of the following code blocks returns a new DataFrame containing the mean of the sqft column from DataFrame storesDF in a column named sqftMean?

Choose two
Explanation

DataFrame.agg aggregates across the entire DataFrame and returns an aggregated DataFrame. The PySpark mean aggregate accepts either a column name or a Column expression; aliasing its result to sqftMean produces the required output column. DataFrame.agg documentation mean documentation

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!