Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this task, you are to graph the physical characteristics of Gentoo penguins using Pandas and Matplotlib. Instructions This task uses a dataset containing

 

For this task, you are to graph the physical characteristics of Gentoo penguins using Pandas and Matplotlib. Instructions This task uses a dataset containing some physical measurements of three penguin species: Adelie, Chinstrap and Gentoo. You can view the dataset online by clicking here. Run the following code cell to load the dataset into a Pandas DataFrame and look at the first few rows. Read through the code before executing it. [] # DO NOT EDIT THIS CODE # Import the modules that we need for this task. import pandas as pd import matplotlib. pyplot as plt # This is the location of the penguin data file on the internet. PENGUINS_URL = 'https://gist.githubusercontent.com/anibali/c2abc8cab4a2f7b0a6518d11a67c693c/raw/3b1bb5264736bb762584104c9e7a828bef0f6ec8/penguins.csv' Bill length (mm) # Download the penguin data and turn it into a Pandas DataFrame object. df = pd.read_csv (PENGUINS_URL) # Display the first few rows of the DataFrame object. display(df.head()) As you can see, the dataset consists of 7 columns. The species of penguin can be Gentoo, Adelie, or Chinstrap. The sex can be MALE or FEMALE. Your task is to produce a scatter plot which relates bill depth and bill length for MALE penguins only where the weight must be above 4kg, with data points separated by the species of penguin. A successful solution produces a plot similar to the example below, which clearly shows how these physical measurements are a good indicator of species for male penguins. You can use whichever three colours for the points you like, provided that the three colours are not the same as each other. Everything else must be identical. 60 55 50 40 35 T 14 T 15 Penguin Measurements by Species T 16 T 17 Bill depth (mm) T 18 19 Adelie Chinstrap Gentoo 20 T 21 PASAKATHAIGIALIUTAMAMANAHOVA MERKATOR ai h h I e C il D il MENER Criteria During marking we will check that your program: Creates three different DataFrames for the different species of male penguins by filtering the data appropriately. (6 marks) You may create an intermediate DataFrame containing all male penguins with at least 4kg in weight to help achieve this. (3 marks) Creates and shows a figure using Matplotlib. (2 marks) Uses the three DataFrames to create 3 scatter plots on the same graph. (6 marks) Uses correct labels for the axes and title. (3 marks) Displays a legend. (2 marks) Produces a graph which closely matches the example. Using any three different colours for the points is allowed. (3 marks) Your Solution # Write your solution here (don't forget to execute the code cell in the # Instructions section first)

Step by Step Solution

3.39 Rating (168 Votes )

There are 3 Steps involved in it

Step: 1

The answer provided below has been developed in a clear step by step mannerStep 1 PLEASE REFER TO TH... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Analytics Methods Models And Decisions

Authors: James R. Evans

2nd Edition

321997824, 978-1119298588, 978-0321997821

More Books

Students also viewed these Programming questions