Bird
Raised Fist0
Data Analysis Pythondata~20 mins

Data analysis workflow (collect, clean, explore, visualize, conclude) in Data Analysis Python - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Data Analysis Workflow Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
2:00remaining
What is the output of this data cleaning step?
Given a DataFrame with missing values, what will be the result after running this code?
Data Analysis Python
import pandas as pd

df = pd.DataFrame({
    'A': [1, 2, None, 4],
    'B': [None, 2, 3, 4]
})

cleaned = df.dropna()
print(cleaned)
A
     A    B
0  1.0  NaN
1  2.0  2.0
2  NaN  3.0
3  4.0  4.0
B
     A    B
1  2.0  2.0
3  4.0  4.0
C
Empty DataFrame
Columns: [A, B]
Index: []
D
     A    B
0  1.0  NaN
3  4.0  4.0
Attempts:
2 left
💡 Hint
dropna() removes rows with any missing values.
❓ data_output
intermediate
2:00remaining
How many unique categories are in this dataset after cleaning?
After removing duplicates, how many unique 'Category' values remain?
Data Analysis Python
import pandas as pd

df = pd.DataFrame({
    'Category': ['A', 'B', 'A', 'C', 'B', 'D', 'D', 'E']
})

cleaned = df.drop_duplicates()
unique_count = cleaned['Category'].nunique()
print(unique_count)
A5
B8
C4
D6
Attempts:
2 left
💡 Hint
drop_duplicates() removes repeated rows, then count unique categories.
❓ visualization
advanced
2:00remaining
Which plot correctly shows the distribution of 'Age' after cleaning?
Given this cleaned DataFrame, which plot code will produce a histogram of 'Age'?
Data Analysis Python
import pandas as pd
import matplotlib.pyplot as plt

df = pd.DataFrame({
    'Age': [22, 25, 29, 35, 40, 40, 22, 30]
})
A
plt.hist(df['Age'])
plt.show()
B
plt.plot(df['Age'])
plt.show()
C
plt.scatter(df.index, df['Age'])
plt.show()
D
plt.boxplot(df['Age'])
plt.show()
Attempts:
2 left
💡 Hint
Histogram shows frequency distribution of a single variable.
🧠 Conceptual
advanced
2:00remaining
What is the correct order of steps in a data analysis workflow?
Arrange these steps in the correct order for a typical data analysis workflow.
A4,2,1,3,5
B1,2,4,3,5
C2,4,1,3,5
D2,1,4,3,5
Attempts:
2 left
💡 Hint
Think about what you do first: get data, then clean it, then explore.
🚀 Application
expert
2:00remaining
What is the mean value of 'Score' after cleaning and filtering?
Given this DataFrame, after removing rows with missing 'Score' and filtering scores >= 70, what is the mean?
Data Analysis Python
import pandas as pd

df = pd.DataFrame({
    'Name': ['Anna', 'Ben', 'Cara', 'Dan', 'Eva'],
    'Score': [85, None, 70, 65, 90]
})

cleaned = df.dropna(subset=['Score'])
filtered = cleaned[cleaned['Score'] >= 70]
mean_score = filtered['Score'].mean()
print(round(mean_score, 2))
A75.00
B80.00
C81.67
D70.00
Attempts:
2 left
💡 Hint
Calculate mean after filtering scores 70 and above.

Practice

(1/5)
1. Which step in the data analysis workflow involves removing errors and fixing missing values in the data?
easy
A. Collect
B. Clean
C. Visualize
D. Conclude

Solution

  1. Step 1: Understand the meaning of each workflow step

    Cleaning data means fixing errors and handling missing values to prepare data for analysis.
  2. Step 2: Match the step to the description

    Removing errors and fixing missing values is exactly what cleaning does, not collecting or visualizing.
  3. Final Answer:

    Clean -> Option B
  4. Quick Check:

    Cleaning = Fix errors and missing values [OK]
Hint: Cleaning fixes errors and missing data [OK]
Common Mistakes:
  • Confusing 'collect' with cleaning
  • Thinking visualization fixes data
  • Mixing 'conclude' with cleaning step
2. Which Python library is commonly used for data visualization in the data analysis workflow?
easy
A. matplotlib
B. scikit-learn
C. numpy
D. pandas

Solution

  1. Step 1: Identify libraries and their main uses

    pandas is for data manipulation, numpy for numerical operations, scikit-learn for machine learning, matplotlib for plotting graphs.
  2. Step 2: Choose the library for visualization

    matplotlib is the standard Python library for creating charts and graphs.
  3. Final Answer:

    matplotlib -> Option A
  4. Quick Check:

    Visualization = matplotlib [OK]
Hint: matplotlib is for plotting graphs [OK]
Common Mistakes:
  • Choosing pandas for visualization
  • Confusing numpy with plotting
  • Selecting scikit-learn for charts
3. What will be the output of this Python code snippet?
import pandas as pd

data = {'age': [25, 30, None, 22], 'score': [88, 92, 85, None]}
df = pd.DataFrame(data)
clean_df = df.dropna()
print(clean_df)
medium
A. DataFrame with all rows including those with None values
B. DataFrame with rows containing None values replaced by 0
C. DataFrame with rows containing None values removed
D. Error because dropna() is not a valid method

Solution

  1. Step 1: Understand what dropna() does in pandas

    dropna() removes rows that have any missing (None/NaN) values.
  2. Step 2: Apply dropna() to the DataFrame

    Rows with None in 'age' or 'score' are removed, leaving only rows with complete data.
  3. Final Answer:

    DataFrame with rows containing None values removed -> Option C
  4. Quick Check:

    dropna() removes rows with missing data [OK]
Hint: dropna() removes rows with missing values [OK]
Common Mistakes:
  • Thinking dropna() replaces missing values
  • Expecting an error from dropna()
  • Assuming dropna() keeps all rows
4. Identify the error in this data exploration code and choose the correct fix:
import pandas as pd

data = {'height': [170, 165, 180], 'weight': [65, 70, 75]}
df = pd.DataFrame(data)
print(df.mean(axis=1))
medium
A. No error, code runs correctly
B. Use df.mean() without axis parameter
C. Replace df.mean(axis=1) with df.sum(axis=1)
D. Change axis=1 to axis=0 to get mean of columns

Solution

  1. Step 1: Understand what df.mean(axis=1) does

    axis=1 calculates the mean across columns for each row, which is valid here.
  2. Step 2: Check if code runs without error

    The code runs correctly and prints the mean height and weight per row.
  3. Final Answer:

    No error, code runs correctly -> Option A
  4. Quick Check:

    df.mean(axis=1) calculates row means [OK]
Hint: axis=1 means row-wise operation [OK]
Common Mistakes:
  • Thinking axis=1 causes error
  • Confusing axis=0 and axis=1
  • Replacing mean with sum unnecessarily
5. You have a dataset with sales data including missing values. Which sequence of steps correctly follows the data analysis workflow to find average sales per region?

Options:
A) Collect data -> Visualize data -> Clean data -> Explore data -> Conclude
B) Collect data -> Clean data -> Explore data -> Visualize data -> Conclude
C) Clean data -> Collect data -> Explore data -> Visualize data -> Conclude
D) Collect data -> Explore data -> Clean data -> Visualize data -> Conclude
hard
A. Collect data -> Visualize data -> Clean data -> Explore data -> Conclude
B. Collect data -> Explore data -> Clean data -> Visualize data -> Conclude
C. Clean data -> Collect data -> Explore data -> Visualize data -> Conclude
D. Collect data -> Clean data -> Explore data -> Visualize data -> Conclude

Solution

  1. Step 1: Recall the correct order of data analysis workflow

    The standard order is: collect data, clean data, explore data, visualize data, then conclude.
  2. Step 2: Match the options to this order

    Collect data -> Clean data -> Explore data -> Visualize data -> Conclude matches the correct sequence exactly.
  3. Final Answer:

    Collect data -> Clean data -> Explore data -> Visualize data -> Conclude -> Option D
  4. Quick Check:

    Workflow order = B [OK]
Hint: Follow collect -> clean -> explore -> visualize -> conclude [OK]
Common Mistakes:
  • Visualizing before cleaning data
  • Cleaning data before collecting it
  • Exploring data before cleaning
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard