Chapter 6
Structuring Data
IN THIS CHAPTER
Defining why data requires structure
Working with stacks, queues, lists, and dictionaries
Using trees to organize data
Using graphs to represent data with relations
Raw data is just that: raw. It’s not structured or cleaned in any way. Before you can do anything with most data, you must structure it in some manner so that you can begin to see what the data contains (and, sometimes, what it doesn’t). The first part of this chapter discusses the need for turning raw data into structured data.
Python provides access to a number of organizational structures for data. The book uses these structures, especially stacks, queues, and dictionaries, for many of the examples. Each data structure provides a different means of working with the data and a different set of tools for performing tasks such as sorting the data into a particular order. This chapter presents you with the most common organizational methods, including both trees and graphs (both of which are so important that they appear in their own sections).
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