Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Practical Python Data Wrangling and Data Quality
## 【One-Line Pitch】
A hands-on guide for journalists, analysts, and researchers who need to turn messy, real-world data into clean, trustworthy datasets using Python—covering everything from data quality assessment to code refactoring. If you've ever felt that your data is "dirty" and you're not sure where to start, this book is your practical roadmap.
## 【Book Arc】
- **Opening (~0%–10%)**: Introduces the core philosophy that data is inherently human-made and therefore flawed, establishing the two key axes of data quality: integrity (how well the data is structured and documented) and fit (how appropriate it is for your specific question). Sets up the book's practical, project-based approach.
- **Early (~10%–25%)**: Walks through setting up a complete Python environment (Miniconda, Jupyter Notebook, Atom editor) and establishing a "data wrangling diary" workflow—emphasizing the importance of writing your research question as a single sentence and using version control (Git/GitHub) to track all changes.
- **Early (~25%–35%)**: Covers Python fundamentals through the lens of data wrangling, introducing the five core data types (numbers, strings, lists, dictionaries, booleans) and the crucial concept that "nouns ≈ variables"—using syntax highlighting and punctuation to reliably identify data types.
- **Middle (~35%–50%)**: Dives into programming structures—custom functions (described as "recipes"), loops, conditionals, and nesting—with a strong emphasis on Python's whitespace-dependent indentation. Introduces exception handling but argues that for data quality work, you often *want* errors to surface rather than silently pass over bad data.
- **Middle (~50%–70%)**: Applies these skills to real data wrangling tasks, using the Citi Bike dataset as a running example. Covers selecting data subsets, regular expressions for string matching, handling dates, cleaning fixed-width files, correcting spelling inconsistencies, and augmenting data with additional sources.
- **Late (~70%–100%)**: Focuses on structuring and refactoring code for maintainability, revisiting custom functions with criteria like "will you use it more than once?" and "is it ugly and confusing?"—plus a comprehensive framework for assessing data quality across dimensions like annotation, volume, consistency, atomicity, clarity, and dimensionality.
## 【Key Takeaways】
- **Data quality has two distinct axes: integrity and fit** (Early): Integrity concerns the data's internal characteristics (completeness, atomicity, annotation), while fit asks whether the data actually answers your question. Both matter, and neither is guaranteed by sophisticated tools.
- **Computers amplify human judgment—they don't replace it** (Early): Even "intelligent" systems are just pattern-matching on human-selected data. The responsibility for data quality rests with the humans who collect, clean, and analyze it.
- **Write your research question as a single sentence** (Early): This simple discipline prevents you from losing track of your goal when data wrangling inevitably leads you down "rabbit holes." Your question becomes the anchor for all subsequent decisions.
- **Python's five data types are identifiable by punctuation alone** (Early): Numbers are just digits, strings have matching quotes, lists use square brackets, dictionaries use braces, and booleans are True/False. This makes type identification reliable and beginner-friendly.
- **Indentation is not optional in Python—it's structural** (Middle): Unlike curly-brace languages, Python uses whitespace to define code blocks. Understanding nesting (one tab per level) is essential for writing loops, conditionals, and functions that work correctly.
- **Exceptions are your friends in data quality work** (Middle): While you *can* write code to handle errors gracefully, the book argues you often *shouldn't*—because silent error handling can hide data quality problems you need to know about.
- **Comments are for your future self, not the computer** (Middle): The book's examples deliberately include more comment lines than code, because you *will* forget what your code does and why. Detailed comments are a sign of good practice, not verbosity.
- **Data cleaning is rarely a straight line** (Middle): The "circuitous path to simple solutions" is normal—real data has spelling inconsistencies, weird date formats, and fixed-width files that need conversion. Expect detours and build them into your workflow.
## 【Reading Tips】
- **Skim the setup chapters (10%–25%) if you already have Python installed**: The Miniconda/Jupyter/Atom installation walkthrough is thorough but platform-specific; focus instead on the "data diary" concept and Git workflow, which are transferable habits.
- **Deep-read the Citi Bike examples (Middle section)**: The running example of counting Subscriber vs. Customer user types is deceptively simple—it demonstrates the full loop of reading data, transforming it, and checking for unexpected values. This is where the book's philosophy becomes concrete.
- **Pay special attention to the "Gotchas" sections**: These are the hard-won lessons from real data wrangling—things like empty values not converting to zero, or Excel dates needing decryption. These will save you hours of debugging later.
- **Don't skip the code comments**: The book deliberately includes extensive inline comments in its examples. Reading them is like having the author explain her thinking process, which is more valuable than just copying the code.
- **Use the data quality framework as a checklist**: The late chapters on assessing data fit (validity, reliability, representativeness) and structural quality (atomicity, clarity, dimensionality) are worth returning to as a reference whenever you start a new dataset.
## 【Coverage Limits】
This guide covers the book's core philosophy, setup, Python fundamentals, and data cleaning approach through the middle sections. The excerpts do not cover the later chapters on advanced data augmentation techniques, code refactoring in depth, or the final data quality assessment frameworks in detail—those sections are summarized from the table of contents rather than excerpted content.
##
Excerpt 1
226 A Simple Split 227 Regular Expressions: Supercharged String Matching 229 Making a Date 233 De-crufting Data Files 235 Decrypting Excel Dates 239 Generati...
it possible to do a wider range of more conclusive analyses. In most cases, however, you’ll find that a given dataset is lacking on any number of data integr...
uction to Data Wrangling and Data Quality Nouns ≈ Variables In the English language, nouns are often described as any word that refers to a “person, place, o...
se for us to deal with runtime errors as they arise, rather than trying to plan for (and handle) all possible errors in advance.6 Of course, it is possible t...
em straightforward, there are Assessing Data Integrity | 81 understanding of its relationship to the world deepens, you may find that you need to revisit ear...
ctReader function has added useful information to our data, # like a label that shows us all the values in the first or "header" row print(politicians_reader...
.join function to save the new files into our target folder. We also have to use the str() function to convert the page number into a string for use in the f...
desc. You can also specify particular data formats (such as file_type=xml for XML output) or units (such as units=pc1 to see the output as percent change fro...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Practical Python Data Wrangling and Data Quality Getting Started with Reading, Cleaning, and Analyzing Data (Susan E. McGregor)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share to WeChat Moments
Practical Python Data Wrangling and Data Quality Getting Started with Reading, Cleaning, and Analyzing Data (Susan E. McGregor)(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Practical Python Data Wrangling and Data Quality Getting Started with Reading, Cleaning, and Analyzing Data (Susan E. McGregor)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
这本书围绕用 Python 做数据整理与数据质量把控展开,面向刚接触数据处理的读者,讲的是如何从读取数据开始,一步步完成清洗与分析前的准备。作者 Susan E. McGregor 把重点放在“实用”二字上,强调数据工作不只是写代码,更包括判断数据是否可靠、是否完整,以及在发现问题后如何回头调整前面的步骤。书中提到,随着对数据与现实世界关系的理解加深,可能需要重新审视早先做过的工作,重复或修正某些环节,这说明数据整理是一个反复迭代的过程,而不是一次性的流水线。
读者可以抓住几条主要线索。一是工具使用的灵活性:作者在需要时同时给出命令行和鼠标操作的说明,让读者按自己觉得方便的方式来完成具体任务。二是调试能力的培养:书中会详细讲解调试,即有条理地修复“坏掉”的代码的过程,并把它作为上手实践的好切入点,帮助读者学会从计算机的报错信息中读出问题所在。三是数据完整性的评估:在把数据写入文件、准备输出时,常常需要根据说明文件里的信息手动设定列名,这类细节正是数据质量工作的一部分。四是网络数据的获取:书中涉及基于网络的数据访问,并提到可以指定输出格式或单位,例如以 XML 格式输出,或按同...
Digital LibraryAI Assistant
Hi — I can help you pick a book. Tell me a topic, language, or level, e.g. “a light English read”. If that's too broad, I'll ask one follow-up.
Loading comments...
Reply to Comment
Edit Comment