Data Wrangling and Manipulation
It is not an exaggeration to say that the majority of work done by the average data analyst revolves around preparing data for use. A large part of this is cleaning the data, as covered in the previous chapter, but it is more than just dealing with things that will cause errors or introduce bias. You will often have to get the data into a specific shape or format before you can use it. This step is often called data wrangling or manipulation. To be clear, when we use the word “manipulation,” we do not mean we are changing the outcome in any way; we are using it in the literal sense of handling and managing the data in a skillful way.
In this chapter, we will go over some of the most important skills in the data-wrangling process. We will talk about the different methods to combine datasets including different types of joins, blends, concatenation, and appending. Next, we will look at the addition of variables that add meaning, such...