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

Certified Associate Developer for Apache Spark Exam - Question 65


Which of the following operations can be used to return a new DataFrame from DataFrame storesDF without columns that are specified by name?

Show Answer
Correct Answer: C

To remove specific columns from a DataFrame and return a new DataFrame without these columns, you use the drop() operation. The filter() function is used for filtering rows, not columns. The select() function is used to specify which columns to include, not exclude. The subset() function is not a standard DataFrame operation for removing columns. The dropColumn() function is not a commonly used DataFrame method. Therefore, storesDF.drop() is the correct method to achieve this.

Discussion

3 comments
Sign in to comment
cookiemonster42Option: B
Aug 28, 2023

in select you can use * instead of the column names

newusernameOption: C
Nov 7, 2023

you should be careful; with the question. The specified columns should not be in the new DF therefore it is drop , you specify in drop what you want to remove and they won't be in the new DF

mehroosaliOption: C
Nov 8, 2023

Its C not B