The answer is E.
Option A returns a 10% sample, not a 15% sample as requested.
Option B is incorrect because sampleBy() is used to perform stratified sampling based on a column's values.
Option C is incorrect because the first argument should be set to False to prevent sampling with replacement.
Option D is incorrect because the sample() method without arguments will return a 50% sample of the DataFrame.
Option E is the correct answer as it returns a sample of 15% of the DataFrame without replacement.
upvoted 3 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
4be8126
1 year, 7 months ago