Chapter 9 of 30
Keep learning and build your Data Science skills.
Data Transformation
Learn how raw variables can be transformed into useful analytical formats.
Theory
Data transformation changes data into a form that is easier to analyze or use in a model.
Common transformations include:
• Scaling
• Normalization
• Encoding
• Log transformation
• Aggregation
• Date transformations
Transformation should be selected according to the characteristics of the data and the requirements of the analysis.
Example
import numpy as np
values = np.array([1, 10, 100])
log_values = np.log(values)
print(log_values)Output
The original values are transformed using a logarithmic transformation.
Practice
Identify three transformations that could be useful for a dataset.
Interview Questions
1
What is data transformation?
2
Why do we transform data?
3
What is normalization?
Quick Quiz
Which option best describes this chapter?
A.Converting data into a useful representation
B.Deleting the database
C.Creating CSS
D.Building a computer network