Path: blob/master/lessons/lesson_02/code/solution-code/Code_2.ipynb
1904 views
Solutions to Lesson 2
Lab 2 Solution
This is a quiz given in Roger Peng's Coursera class Computing for Data Analysis. _
Sourced from Research Computing MeetUp's Python course.
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)?
Next Steps
Recommended Resources
Name | Description |
---|---|
Official Pandas Tutorials | Wes & Company's selection of tutorials and lectures |
Julia Evans Pandas Cookbook | Great resource with eamples from weather, bikes and 311 calls |
Learn Pandas Tutorials | A great series of Pandas tutorials from Dave Rojas |
Research Computing Python Data PYNBs | A super awesome set of python notebooks from a meetup-based course exclusively devoted to pandas |