Dunder Data Pandas Challenge Solutions 1–5

Ted Petrou
Dunder Data
Published in
2 min readNov 18, 2021

--

The solutions to the five Dunder Data Pandas Challenges will be presented below. Try these challenges for yourself at python.dunderdata.com before looking at the solutions. Video solutions for all of the challenges are available on YouTube. The following two datasets are used for the challenges.

import pandas as pd

emp = pd.read_csv('../data/employee.csv', parse_dates=['hire_date'])
emp.head(3)
png
movie = pd.read_csv('../data/movie.csv', index_col='title')
movie.head(3)

Challenge 1 (1pt)

Select the first five rows for columns title and salary.

def exercise_1(df):
"""
Parameters
----------
df: DataFrame

Returns
-------
DataFrame
"""
# YOUR CODE HERE
return df[['title', 'salary']].head()

Video solution to challenge #1

Challenge 2 (1pt)

--

--

Ted Petrou
Dunder Data

Author of Master Data Analysis with Python and Founder of Dunder Data