Midterm

Congratulations; we are about two-thirds through the course! We will now review what you've learned so far by checking your understanding! This is an optional assignment provided to gauge how well you've absorbed material we've covered thus far.

Question 1

In the following code block, fill in the missing code to show that the data type of the first element of Petal.Length is of type float.

Question 2

Fill in the code to calculate a column named Sepal_Width_2 with the formula Sepal.Width + 2. Then show the mean of this column is 5.05733.

Question 3

In the following group_by and mean code, what will the dimensions be in the returned dataframe? Try to answer this before running the code.

Question 4

Use the isin method to subset the iris dataframe to only rows that contain versicolor and virginica, what are the dimensions of this dataframe after the filter?

Question 5

Use assign, query and sum to: create a variable that is twice the value of Petal.Length, filter this new column to values that are less than 10, and then find the sum of all of these values.