Question: In [ 1: # Write a function called species that separates your data set by species # Your function should take two arguments: -

In [ 1: # Write a function called species that separates your data set by species # Your function should take

In [ 1: # Write a function called species that separates your data set by species # Your function should take two arguments: - an index that goes from 0 to 2 and represents the species - the label of the species # # Your function should return a subset of the original data array. One subset per sepcies. #using plt.scatter, your function should graph the sepal width as a function of the sepal lentgh, add a label fo. #using plt.scatter, your function should also overplot the petal width as a function of the petal lentgh, add a # and display the legend on the graph #label the x and y axis In [10] # Create a for loop that loop over the range 0 to 3 included # Created a nested if statements for each species # If the index in the species column is equal to 1, then #create a varaible called label asd assign it to "Setosa" - call the species function using the index from the for loop and the species label # If the index in the species column is equal to 2, then # create a varaible called label asd assign it to "Versicolor" #call the species function using the index from the for loop and the species label #If the index in the species column is equal to 3, then - create a varaible called label asd assign it to "Virginica" #call the species function using the index from the for loop and the species label the output of your for loop must be a graph showing the width as function of the length for the sepal and petal of

Step by Step Solution

3.53 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is an example implementation of the species function in Python python import matplotlibpyplot a... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!