Path: blob/master/april_18/lessons/lesson-02/code/solution-code/solution-code-2.ipynb
1905 views
Solutions to Lesson 2
Lab 2 Solution
This is a quiz given in Roger Peng's Coursera class Computing for Data Analysis.
Print the column names of the dataset to the screen, one column name per line.
Extract the first 2 rows of the data frame and print them to the console. What does the output look like?
How many observations (i.e. rows) are in this data frame?
Extract the last 2 rows of the data frame and print them to the console. What does the output look like?
What is the value of Ozone in the 47th row?
How many missing values are in the Ozone column of this data frame?
What is the mean of the Ozone column in this dataset? Exclude missing values (coded as NA) from this calculation.
Extract the subset of rows of the data frame where Ozone values are above 31 and Temp values are above 90. What is the mean of "Solar.R" in this subset?
What is the mean of "Temp" when "Month" is equal to 6?
What was the maximum ozone value in the month of May (i.e. Month = 5)?