Join Michele Vallisneri for an in-depth discussion in this video Computing daily records, part of Introduction to Data Analysis with Python.
- What I would like to do now…is to show some context when I plot temperature data…for a year by plotting, also, historical records,…that is the most extreme temperatures…achieved on that day of the year…across all available years.…While we do that. we'll learn how to combine Boolean masks…in NumPy using logical operations,…how to computer maximum and minimum…across a single dimension in a 2-dimensional array,…and how to plot a shaded area with matplotlib.…Let's go to the path on notebook.…
We'll load the 05_06 Records Begin notebook,…which contains all of the code that…we have developed so far. We'll evaluate all cells.…This will take a moment.…To compute records, we will recast the temperature data…in the form of a 2-dimensional array,…where each row corresponds to a year…and each column to a day.…We start by writing a function that extracts…a single year of data.…For that, we will use NumPy Boolean mask indexing.…
We named the function selectyear.…We create NumPy daytime 64 objects…corresponding to the start and the end of the year.…
- Writing and running Python in iPython
- Using Python lists and dictionaries
- Creating NumPy arrays
- Indexing and slicing in NumPy
- Downloading and parsing data files into NumPy and Pandas
- Using multilevel series in Pandas
- Aggregating data in Pandas
Skill Level Intermediate
Q: The course shows how to download files from FTP and web servers using Python 3.X. How do I do the same thing with Python 2.7?
A: First import urllib, then use urllib.urlretrieve(URL,filename). For instance, to download the stations.txt files used in the chapter 5 video “Downloading and parsing data files,” you’d do urllib.urlretrieve(‘ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/ghcnd-stations.txt','stations.txt').
1. Installation and Setup
2. Refresher: Data Containers in Python
3. Word Anagrams in Python
4. Introduction to NumPy
5. Weather Data with NumPy
6. Introduction to Pandas
7. Baby Names with Pandas
Next steps1m 36s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.