Skip to Content
Python数据处理
book

Python数据处理

by Jacqueline Kazil, Katharine Jarmul
July 2017
Intermediate to advanced
398 pages
11h 54m
Chinese
Posts & Telecom Press
Content preview from Python数据处理
122
7
如果你想展示你的发现并发布数据,就要发布清洗过的版本。这样其他数据处理人员就能
轻松导入并分析数据。你还可以在发布最终数据集的同时发布原始数据,并说明你是如何
一步步清洗数据并将其归一化的。
在清洗数据的过程中,我们希望记下清洗过程的每一步,这样就可以在研究中为我们的数
据集及其使用方法申辩,同时也可以方便我们自己以及其他人的后续使用。通过记录清洗
过程,在遇到新的数据时我们可以重复整个过程。
如果你用
IPython
与数据交互,一个强大的工具是
IPython
的魔法命令,比
%logstart
https://ipython.org/ipython-doc/dev/interactive/magics.html#magic-
logstart
)可用于记录日志,
%save
https://ipython.org/ipython-doc/dev/interactive/
magics.html#magic-save
)可以保存当前会话供以后使用。这样你就可以在
Python
终端里创建脚本,而不仅仅是一行行的代码。随着对
Python
的进一
步学习,你可以完善脚本并与其他人分享。想了解更多
IPython
的内容,可
查阅附录
F
下面我们开始学习数据清洗的基础知识,学习如何格式化数据,以及如何将多个数据集正
确地匹配在一起。
7.2
 数据清洗基础知识
如果已经完成了前面几章的代码练习,你就已经用到了一些数据清洗的概念。在第
4
章,
我们从
Excel
工作表里导出数据,并创建一个字典来表示这些数据。修改数据使其满足新 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

数据科学中的实用统计学(第2版)

数据科学中的实用统计学(第2版)

Peter Bruce, Andrew Bruce, Peter Gedeck
Java持续交付

Java持续交付

Daniel Bryant, Abraham Marín-Pérez
解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787115459190