Challenge - 5 Problems
Data Science Language Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of data frame summary in R
What is the output of the following R code snippet?
R Programming
df <- data.frame(age = c(25, 30, 35, 40, 45), score = c(88, 92, 95, 85, 90)) summary(df)
Attempts:
2 left
💡 Hint
summary() in R gives statistical summaries for each column in a data frame.
✗ Incorrect
The summary() function in R returns minimum, 1st quartile, median, mean, 3rd quartile, and maximum for numeric columns in a data frame.
🧠 Conceptual
intermediate2:00remaining
Key difference in data handling between R and Python
Which statement best describes a key difference in how R and Python handle data analysis?
Attempts:
2 left
💡 Hint
Think about how each language treats data frames and libraries.
✗ Incorrect
R has data frames as a core part of the language, while Python uses pandas library to provide similar functionality. R's data frames are more native and integrated.
🔧 Debug
advanced2:00remaining
Identify the error in R code for reading CSV
What error will this R code produce?
R Programming
data <- read.csv('datafile.csv', header=FALSE, sep=';') head(data)
Attempts:
2 left
💡 Hint
Check if the file exists in the working directory.
✗ Incorrect
If the file 'datafile.csv' does not exist in the current directory, read.csv will throw a file not found error.
❓ data_output
advanced2:00remaining
Output of Python pandas groupby aggregation
What is the output of this Python code using pandas?
R Programming
import pandas as pd df = pd.DataFrame({'team': ['A', 'A', 'B', 'B'], 'points': [10, 15, 10, 5]}) result = df.groupby('team').sum() print(result)
Attempts:
2 left
💡 Hint
groupby sums points for each team.
✗ Incorrect
The groupby('team').sum() aggregates points by team, summing values for each group.
🚀 Application
expert3:00remaining
Choosing between R and Python for a project
You have a project requiring advanced statistical modeling and interactive visualizations. Which choice is best and why?
Attempts:
2 left
💡 Hint
Consider the strengths of each language in statistics and visualization.
✗ Incorrect
R is well-known for advanced statistics and has Shiny for interactive web apps, making it ideal for this project.