Skip to content
New Workbook
Sign up
Competition - Everyone Can Learn Data Scholarship
0

Everyone Can Learn Data Scholarship

📖 Background

The second "Everyone Can Learn Data" Scholarship from DataCamp is now open for entries.

The challenges below test your coding skills you gained from beginner courses on either Python, R, or SQL. Pair them with the help of AI and your creative thinking skills and win $5,000 for your future data science studies!

The scholarship is open to secondary and undergraduate students, and other students preparing for graduate-level studies (getting their Bachelor degree). Postgraduate students (PhDs) or graduated students (Master degree) cannot apply.

The challenge consist of two parts, make sure to complete both parts before submitting. Good luck!

💡 Learn more

The following DataCamp courses can help review the skills to get started for this challenge:

  • Intermediate Python
  • Introduction to the Tidyverse in R
  • Introduction to SQL

ℹī¸ Introduction to Data Science Notebooks

You can skip this section if you are already familiar with data science notebooks.

Data science notebooks

A data science notebook is a document containing text cells (what you're reading now) and code cells. What is unique with a notebook is that it's interactive: You can change or add code cells and then run a cell by selecting it and then clicking the Run button to the right ( â–ļ, or Run All on top) or hitting control + enter.

The result will be displayed directly in the notebook.

Try running the Python cell below:

# Run this cell to see the result (click on Run on the right, or Ctrl|CMD + Enter)
100 * 1.75 * 2

Modify any of the numbers and rerun the cell.

You can add a Markdown, Python|R, or SQL cell by clicking on the Add Markdown, Add Code, and Add SQL buttons that appear as you move the mouse pointer near the bottom of any cell.

🤖 You can also make use of our AI assistent, by asking it what you want to do. See it in action here.

Here at DataCamp, we call our interactive notebook Workspace. You can find out more about Workspace here.

1ī¸âƒŖ Part 1 (Python) - Dinosaur data đŸĻ•

📖 Background

You're applying for a summer internship at a national museum for natural history. The museum recently created a database containing all dinosaur records of past field campaigns. Your job is to dive into the fossil records to find some interesting insights, and advise the museum on the quality of the data.

💾 The data

You have access to a real dataset containing dinosaur records from the Paleobiology Database (source):

Column nameDescription
occurence_noThe original occurrence number from the Paleobiology Database.
nameThe accepted name of the dinosaur (usually the genus name, or the name of the footprint/egg fossil).
dietThe main diet (omnivorous, carnivorous, herbivorous).
typeThe dinosaur type (small theropod, large theropod, sauropod, ornithopod, ceratopsian, armored dinosaur).
length_mThe maximum length, from head to tail, in meters.
max_maThe age in which the first fossil records of the dinosaur where found, in million years.
min_maThe age in which the last fossil records of the dinosaur where found, in million years.
regionThe current region where the fossil record was found.
lngThe longitude where the fossil record was found.
latThe latitude where the fossil record was found.
classThe taxonomical class of the dinosaur (Saurischia or Ornithischia).
familyThe taxonomical family of the dinosaur (if known).

The data was enriched with data from Wikipedia.

# Import the pandas and numpy packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Load the data
dinosaurs = pd.read_csv('data/dinosaurs.csv')
# Preview the dataframe
dinosaurs

đŸ’Ē Challenge I

Help your colleagues at the museum to gain insights on the fossil record data. Include:

  1. How many different dinosaur names are present in the data?
  2. Which was the largest dinosaur? What about missing data in the dataset?
  3. What dinosaur type has the most occurrences in this dataset? Create a visualization (table, bar chart, or equivalent) to display the number of dinosaurs per type. Use the AI assistant to tweak your visualization (colors, labels, title...).
  4. Did dinosaurs get bigger over time? Show the relation between the dinosaur length and their age to illustrate this.
  5. Use the AI assitant to create an interactive map showing each record.
  6. Any other insights you found during your analysis?

Q1. Finding the number of different dinosaur names that are present in the data.

 #Calculate the number of unique dinosaur names in the 'name' column of the 'dinosaurs' DataFrame
distinct_dinosaur_names = dinosaurs['name'].nunique()

# Print the number of distinct dinosaur names with a descriptive message
print(f'There are {distinct_dinosaur_names} different names of dinosaurs present in the data.')

Q2. Which was the largest dinosaur? What about missing data in the dataset?

# Group by 'name' and 'type', then calculate the maximum length for each group
# Reset the index to convert the result to a DataFrame
largest_dinosaurs = dinosaurs.groupby(['name', 'type'])['length_m'].max().reset_index()

# Sort the DataFrame by 'length_m' in descending order to identify the largest dinosaurs by length
largest_dinosaurs = largest_dinosaurs.sort_values(by='length_m', ascending=False)

# Print the largest sauropod dinosaurs, assuming 'Supersaurus' and 'Argentinosaurus' are among the largest
print("The largest dinosaurs are:")
print(largest_dinosaurs.loc[
    (largest_dinosaurs["name"].isin(["Supersaurus", "Argentinosaurus"])) & 
    (largest_dinosaurs["type"] == "sauropod")
])

# Filter rows where any of the specified columns have missing values
missing_dinosaurs_data = dinosaurs[dinosaurs[['name', 'length_m', 'class', 'family', 'region','diet']].isnull().any(axis=1)]

# Count the number of rows with missing values in any of the specified columns
missing_count_data = missing_dinosaurs_data.shape[0]

# Print the count of rows with missing data
print(f'There are {missing_count_data} rows with missing values in the specified columns.')


‌
‌
‌