Join Michele Vallisneri for an in-depth discussion in this video Loading the dictionary, part of Introduction to Data Analysis with Python.
- We begin by loading a dictionary of English words…into Python.…To do so we open a Python notebook from the shell…as we did before.…And we find the location in the file system…where we have our exercise files.…We select the exercise file for this video.…It begins as empty.…This exercise file directory contains a file named "Words"…that contains English words from the nineteen thirty four…Webster Dictionary.…We're going to use it to find our anagrams.…
Let's start by taking a look at this file.…The way you open files in Python…is with the keyword open.…Followed by the file name…and the mode in which you're going to be…accessing the file.…In this case we're going to read it.…Now word is a file object that can be used in many ways.…For instance, we may use the method readlines which returns…a list of all the lines in the file.…We use the Python notebook word completion feature…to go faster.…
So let's see the first few lines…using the slice annotation for lists,…that we have learned in chapter 2.…Here we go.…How many words do we have?…
- 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
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?
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.