QuestionQ68

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

Which of the following code blocks returns a 15 percent sample of rows from the DataFrame storesDF without replacement?

Explanation

DataFrame.sample uses fraction to specify the sampling proportion, and its withReplacement parameter defaults to False. Therefore, a fraction of 0.15 produces a 15 percent sample without replacement.

Learn more

Community Discussion

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