Chapter 4. Data wrangling: from capture to domestication

 

This chapter covers

  • Ways to wrangle data
  • Helpful tools and techniques
  • Some common pitfalls

One definition of wrangling is “having a long and complicated dispute.” That sounds about right.

Data wrangling is the process of taking data and information in difficult, unstructured, or otherwise arbitrary formats and converting it into something that conventional software can use. Like many aspects of data science, it’s not so much a process as it is a collection of strategies and techniques that can be applied within the context of an overall project strategy. Wrangling isn’t a task with steps that can be prescribed exactly beforehand. Every case is different and takes some problem solving to get good results. Before I discuss specific techniques and strategies of data wrangling, as shown in figure 4.1, I’ll introduce a case study that I’ll use to illustrate those techniques and strategies throughout the chapter.

Figure 4.1. The third step of the preparation phase of the data science process: data wrangling

4.1. Case study: best all-time performances in track and field

4.2. Getting ready to wrangle

4.3. Techniques and tools

4.4. Common pitfalls

Exercises

Summary