Exam Certified Associate Developer for Apache Spark All QuestionsBrowse all questions from this exam
Question 76

Which of the following code blocks returns the number of rows in DataFrame storesDF for each unique value in column division?

    Correct Answer: E

    To get the number of rows in a DataFrame for each unique value in a specified column, the correct approach is to use the groupBy function on the desired column and then apply the count function. The code storesDF.groupBy("division").count() correctly groups the rows by the 'division' column and counts the number of rows for each unique value in that column.

Discussion
azure_bimonsterOption: E

E is the right answer here