Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python Data Cleaning and Preparation Best Practices

You're reading from   Python Data Cleaning and Preparation Best Practices A practical guide to organizing and handling data from various sources and formats using Python

Arrow left icon
Product type Paperback
Published in Sep 2024
Publisher Packt
ISBN-13 9781837634743
Length 456 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Maria Zervou Maria Zervou
Author Profile Icon Maria Zervou
Maria Zervou
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Part 1: Upstream Data Ingestion and Cleaning
2. Chapter 1: Data Ingestion Techniques FREE CHAPTER 3. Chapter 2: Importance of Data Quality 4. Chapter 3: Data Profiling – Understanding Data Structure, Quality, and Distribution 5. Chapter 4: Cleaning Messy Data and Data Manipulation 6. Chapter 5: Data Transformation – Merging and Concatenating 7. Chapter 6: Data Grouping, Aggregation, Filtering, and Applying Functions 8. Chapter 7: Data Sinks 9. Part 2: Downstream Data Cleaning – Consuming Structured Data
10. Chapter 8: Detecting and Handling Missing Values and Outliers 11. Chapter 9: Normalization and Standardization 12. Chapter 10: Handling Categorical Features 13. Chapter 11: Consuming Time Series Data 14. Part 3: Downstream Data Cleaning – Consuming Unstructured Data
15. Chapter 12: Text Preprocessing in the Era of LLMs 16. Chapter 13: Image and Audio Preprocessing with LLMs 17. Index 18. Other Books You May Enjoy

Dimensions of data quality

As emphasized earlier, superior data quality forms the foundation upon which informed decisions and strategic insights are built. With this in mind, let us now examine which Key Performance Indicators (KPIs) we could use to measure the data quality of our assets.

Completeness

Completeness measures the extent to which data is complete and lacks missing values or fields. KPIs can include metrics such as the percentage of missing data or missing data points per record.

The following code will output the completeness percentages for each column in your dataset. A higher percentage indicates a higher level of completeness, while a lower percentage suggests more missing values:

  1. We’ll start by importing the pandas library to work with the dataset:
    import pandas as pd
  2. Next, we create a sample dataset with the following columns: Name, Age, Gender, and City. Some values are intentionally missing (represented as None):
    data = {
      ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime