Python practice: Capstone Business Analytics Case Study

Chapter 32 · 8 questions · included in full access

  1. Question 1 · easy

    Structuring an enterprise analytics pipeline

    In an end-to-end data pipeline, in which sequence should an analyst execute data processing operations?

    Solve it in your browser
  2. Question 2 · easy

    Capstone Step 1: Multi-source ingestion & hygiene

    Load "orders_messy.csv". Drop duplicate rows using .drop_duplicates().copy(). Fill missing values in "Units" with the median of "Units" using .fillna(). Print the sum of "Units" in the cleaned DataFrame (int(clean["Units"].sum())):

    Solve it in your browser
  3. Question 3 · medium

    Capstone Step 2: String normalization & standardization

    Load "orders_messy.csv". Drop duplicates. Normalize the "Customer" column by stripping whitespace and converting to title case using .str.strip().str.title(). Print the customer name at index 0 (clean["Customer"].iloc[0]):

    Solve it in your browser
  4. Question 4 · medium

    Capstone Step 3: Relational enrichment with reps master

    Load "sales.csv" and "reps.csv". Left join on ["Rep", "Region"]. Print the count of rows in the enriched dataset (len(enriched)):

    Solve it in your browser
  5. Question 5 · medium

    Capstone Step 4: Engineer gross margin metric

    Load "sales.csv". Engineer a feature sales["Margin"] = sales["Revenue"] * 0.3 (representing a 30% gross profit margin). Print the sum of "Margin" across all orders as an integer (int(sales["Margin"].sum())):

    Solve it in your browser
  6. Question 6 · medium

    Capstone Step 5: Monthly cohort aggregation report

    Load "sales.csv". Parse Date as datetime. Group by month (sales["Date"].dt.month) and use .agg() to compute revenue=("Revenue", "sum") and orders=("OrderID", "count"). Print the total revenue for Month 1 as an integer (int(monthly.loc[1, "revenue"])):

    Solve it in your browser
  7. Question 7 · hard

    Capstone Step 6: Quota attainment leaderboard

    Load "sales.csv" and "reps.csv". Left join on ["Rep", "Region"]. Aggregate total revenue by Rep and Target: rep_totals = enriched.groupby(["Rep", "Target"])["Revenue"].sum().reset_index(). Compute rep_totals["Attainment"] = (rep_totals["Revenue"] / rep_totals["Target"]) * 100. Sort descending and print the top attainment rep name (top_rep = rep_totals.sort_values("Attainment", ascending=False).iloc[0]["Rep"]):

    Solve it in your browser
  8. Question 8 · hard

    Capstone Step 7: Master executive KPI dashboard table

    Load "sales.csv". Create a master regional executive summary: summary = sales.groupby("Region").agg(orders=("OrderID", "count"), total_rev=("Revenue", "sum"), avg_units=("Units", "mean")).reset_index(). Print the shape of the summary table as a tuple (summary.shape):

    Solve it in your browser

These questions are part of full access.

The first chapters of every track are free. Full access is a one-time payment.

See pricing