0
0
Agentic_aiml~20 mins

Data analysis agent pipeline in Agentic Ai - Practice Problems & Coding Challenges

Choose your learning style8 modes available
Challenge - 5 Problems
🎖️
Data Analysis Agent Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 code output
intermediate
2:00remaining
Output of a simple data filtering step in an agent pipeline
Consider an agent pipeline that filters a dataset to include only rows where the value in column 'age' is greater than 30. What is the output DataFrame after this filtering?
Agentic_ai
import pandas as pd

data = pd.DataFrame({'name': ['Alice', 'Bob', 'Charlie', 'David'], 'age': [25, 35, 30, 40]})
filtered_data = data[data['age'] > 30]
print(filtered_data)
A
    name  age
0  Alice   25
2  Charlie 30
B
    name  age
1    Bob   35
3  David   40
C
    name  age
1    Bob   35
2  Charlie 30
3  David  40
D
Empty DataFrame
Columns: [name, age]
Index: []
Attempts:
2 left
data output
intermediate
2:00remaining
Result of aggregation in a data analysis pipeline
An agent pipeline groups data by 'department' and calculates the average salary. What is the resulting DataFrame?
Agentic_ai
import pandas as pd

data = pd.DataFrame({'department': ['HR', 'IT', 'HR', 'IT', 'Finance'], 'salary': [50000, 60000, 55000, 65000, 70000]})
grouped = data.groupby('department')['salary'].mean().reset_index()
print(grouped)
A
  department   salary
0   Finance  70000.0
1        HR  52500.0
2        IT  62500.0
B
  department   salary
0   Finance  60000.0
1        HR  55000.0
2        IT  65000.0
C
  department   salary
0   Finance  70000
1        HR  105000
2        IT  125000
D
  department   salary
0   Finance  70000.0
1        HR  55000.0
2        IT  60000.0
Attempts:
2 left
visualization
advanced
3:00remaining
Identify the correct plot output from a data analysis agent pipeline
An agent pipeline creates a bar plot showing total sales per product category. Which option correctly describes the plot output?
Agentic_ai
import pandas as pd
import matplotlib.pyplot as plt

data = pd.DataFrame({'category': ['A', 'B', 'A', 'C', 'B'], 'sales': [100, 200, 150, 300, 250]})
totals = data.groupby('category')['sales'].sum()
totals.plot(kind='bar')
plt.show()
AA bar chart with categories A, B, C on x-axis and bars showing sales totals 250, 450, 300 respectively.
BA line chart with categories A, B, C on x-axis and sales totals 100, 200, 300 respectively.
CA pie chart showing sales distribution with slices for categories A, B, C with values 100, 200, 300.
DA scatter plot with sales on x-axis and categories on y-axis.
Attempts:
2 left
🔧 debug
advanced
2:00remaining
Identify the error in a data cleaning step of an agent pipeline
An agent pipeline tries to fill missing values in a DataFrame column 'score' with the mean score but raises an error. What is the error?
Agentic_ai
import pandas as pd

data = pd.DataFrame({'score': [10, None, 30, None, 50]})
mean_score = data['score'].mean()
data['score'] = data['score'].fillna(mean_score())
print(data)
ANo error, outputs filled DataFrame
BKeyError: 'score' not found
CValueError: cannot convert float NaN to integer
DTypeError: 'float' object is not callable
Attempts:
2 left
🚀 application
expert
3:00remaining
Determine the final output of a multi-step data analysis agent pipeline
An agent pipeline performs these steps on a DataFrame: 1) filters rows where 'value' > 10, 2) creates a new column 'value_squared' as square of 'value', 3) groups by 'category' and sums 'value_squared'. What is the final output DataFrame?
Agentic_ai
import pandas as pd

data = pd.DataFrame({'category': ['X', 'Y', 'X', 'Y', 'Z'], 'value': [5, 15, 20, 8, 25]})
filtered = data[data['value'] > 10]
filtered['value_squared'] = filtered['value'] ** 2
grouped = filtered.groupby('category')['value_squared'].sum().reset_index()
print(grouped)
A
  category  value_squared
0        X           400
1        Y           64
2        Z           625
B
  category  value_squared
0        X           425
1        Y           225
2        Z           625
C
  category  value_squared
0        X           400
1        Y           225
2        Z           625
D
  category  value_squared
0        X           400
1        Y           225
Attempts:
2 left