
Explanation:
The question asks for operations that return a new DataFrame excluding specified columns by name.
select() can achieve this. For example, storesDF.select([col for col in storesDF.columns if col not in columns_to_drop]) excludes specified columns.storesDF.drop('col1', 'col2').filter() (A) affects rows, not columns. subset() (D) is not a valid DataFrame method. dropColumn() (E) does not exist in Spark; the correct method is drop().Ultimate access to all questions.
No comments yet.
Which of the following operations can be used to create a new DataFrame from DataFrame storesDF by excluding columns specified by name?
A
storesDF.filter()
B
storesDF.select()
C
storesDF.drop()
D
storesDF.subset()
E
storesDF.dropColumn()