Which of the following operations can be used to return a DataFrame with no duplicate rows? Please select the most complete answer.
Select an option, then click Submit answer.
Reference / correct answer:
DataFrame.dropDuplicates(), DataFrame.distinct() and DataFrame.drop_duplicates()
Most accepted answer: E. DataFrame.dropDuplicates(), DataFrame.distinct() and DataFrame.drop_duplicates()
Community votes: E=1
Answer E drop_duplicates() is an alias for dropDuplicates() it also work in pyspark upvoted 2 times
Selected Answer: E it asks "most complete" one, so E would be correct as all these three options would work in pyspark upvoted 1 times
B The most complete answer is B. DataFrame.dropDuplicates() and DataFrame.distinct(). Both DataFrame.distinct() and DataFrame.dropDuplicates() methods in PySpark can be used to return a new DataFrame with duplicate rows removed. The DataFrame.drop_duplicates() method is used in pandas, not in PySpark. upvoted 1 times juadaves 2 years, 3 months ago It should be E, drop_duplicates() works in pyspark too. upvoted 1 times ...
It should be E, drop_duplicates() works in pyspark too. upvoted 1 times