- Practical Data Wrangling
- Allan Visochek
- 278字
- 2021-07-02 15:16:04
Shaping and structuring data
Preparing data for its end use often requires both structuring and organizing the data in the correct manner.
To illustrate this, suppose you have a hierarchical dataset of city populations, as shown in Figure 01:

If the goal is to create a histogram of city populations, the previous data format would be hard to work with. Not only is the information of the city populations nested within the data structure, but it is nested to varying degrees of depth. For the purposes of creating a histogram, it is better to represent the data as a list of numbers, as shown in Figure 02:

Making structural changes like this for large datasets requires you to build programs that can extract the data from one format and put it into another format. Shaping data is an important part of data wrangling because it ensures that the data is compatible with its intended use. In Chapter 4, Reading, Exploring, and Modifying Data - Part II, I will walk through exercises to convert between data formats.
Changing the form of data does not necessarily need to involve changing its structure. Changing the form of a dataset can involve filtering the data entries, reducing the data by category, changing the order of the rows, and changing the way columns are set up.
All of the previously mentioned tasks are features of the dplyr package for R. In Chapter 7, Simplifying Data Manipulation with dplyr, I will show how to use dplyr to easily and intuitively manipulate data.
- Splunk 7 Essentials(Third Edition)
- Visualforce Development Cookbook(Second Edition)
- Getting Started with Clickteam Fusion
- 21天學(xué)通C#
- 大數(shù)據(jù)安全與隱私保護
- 完全掌握AutoCAD 2008中文版:綜合篇
- Photoshop CS3圖層、通道、蒙版深度剖析寶典
- 網(wǎng)絡(luò)綜合布線設(shè)計與施工技術(shù)
- 精通數(shù)據(jù)科學(xué)算法
- 電氣控制與PLC技術(shù)應(yīng)用
- 單片機原理實用教程
- 手把手教你學(xué)Flash CS3
- 步步驚“芯”
- 電氣控制及Micro800 PLC程序設(shè)計
- Serverless Design Patterns and Best Practices