Join Michele Vallisneri for an in-depth discussion in this video A yearly top ten, part of Introduction to Data Analysis with Python.
- Next, we'd like to extract the ten most popular names…in any given year.…As we do that, we will learn how to sort a DataFrame,…how to drop columns,…how to join two frames matching their indexes,…and how to count values in a Series.…Let's go to the IPython Notebook…and let's select the 07 04 topten begin exercise file.…This notebook contains all the code that we have developed…so far in this chapter.…We're going to evaluate all cells…by selecting cell, run all.…
All done.…From our DataFrame all years indexed,…we can select all data for a year…using a .loc selection object.…For instance, 2008.…Next, we want to sort this selection.…Actually, let's sort it the right way,…with larger numbers on top.…So with the sort, the ascending is false.…Very well.…The most popular name in 2008…for a boy was Jacob.…
Let's simplify this a bit,…and assign this table to a variable,…by copying this code into the next cell…and feeding it to pop2008.…Then I will reset the index,…and drop several columns that I do not care about.…I'm dropping columns, so axis is one.…
- 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 <span style="font-family: Courier;">import urllib</span>, then use <span style="font-family: Courier;">urllib.urlretrieve(URL,filename)</span>. For instance, to download the stations.txt files used in the chapter 5 video “Downloading and parsing data files,” you’d do <span style="font-family: Courier;">urllib.urlretrieve(‘ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/ghcnd-stations.txt','stations.txt')</span>.
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.