Courseiva
Exploratory Data AnalysismediumMultiple ChoiceObjective-mapped

MLS-C01 Exploratory Data Analysis Practice Question

A data scientist is exploring a dataset containing customer transactions. They want to create a feature that captures the average purchase amount per customer over the last 30 days. Which approach is most efficient in Amazon SageMaker Processing?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use PySpark with window functions in SageMaker Processing

Using PySpark with window functions in SageMaker Processing allows efficient distributed computation for grouped time-series aggregations like average purchase amount per customer over the last 30 days. Option A is wrong because Amazon Athena SQL requires moving data out of SageMaker Processing and may not be as tightly integrated. Option C is wrong because iterating over rows with a Python for loop is inefficient and does not scale. Option D is wrong because pandas groupby and rolling functions may not scale to large datasets in a distributed environment; SageMaker Processing with PySpark provides better performance.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use Amazon Athena SQL query with GROUP BY

    Why it's wrong here

    Incorrect: Athena is a query service, but the data must be in a queryable format; this is not a processing job.

  • Use PySpark with window functions in SageMaker Processing

    Why this is correct

    Correct: PySpark window functions are optimized for large-scale grouped rolling aggregates.

  • Use a Python script with a for loop to calculate per customer

    Why it's wrong here

    Incorrect: For loops are inefficient and do not scale.

  • Use pandas groupby and rolling functions

    Why it's wrong here

    Incorrect: Pandas may not handle large datasets efficiently in memory.

About these practice questions

This MLS-C01 question is part of Courseiva's 1,672-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This MLS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the MLS-C01 exam.