Chapter 6

Structuring Data


check Defining why data requires structure

check Working with stacks, queues, lists, and dictionaries

check Using trees to organize data

check Using graphs to represent data with relations

Raw data is just that: raw. It’s not structured or cleaned in any way. You might find some parts of it missing or damaged in some way, or simply that it won’t work for your problem. In fact, you’re not entirely sure just what you’re getting because it’s raw.

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). Structuring data entails organizing it in some way so that all the data has the same attributes, appearance, and components. For example, you might get data from one source that contains dates in string form and another source that uses date objects. To use the information, you must make the kinds of data match. Data sources might also structure the data differently. One source might have the last and first name in a single field; another source might use individual ...

Get Algorithms For Dummies now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.