Chapter 4
Cruising Massive Data with Dictionaries
IN THIS CHAPTER
Why use data dictionaries?
Creating a data dictionary
Looping through a dictionary
Data dictionary methods
Data dictionaries, also called associative arrays in some languages, are kind of like lists, which we discuss in Chapter 3. But instead of each item in the list being identified by its position in the list, each item is uniquely identified by a key. You can define the key, which can be a string or a number, yourself. All that matters is that it be unique to each item in the dictionary.
To understand why uniqueness matters, think about phone numbers, email addresses, and Social Security numbers. If two or more people had the same phone number, then whenever someone called that number, all those people would get the call. If two or more people had the same email address, then all those people would get the same email messages. If two or more people had the same Social Security number, and one of those people was a million dollars behind in their taxes, you better hope you can convince the tax folks you’re not the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access