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数据处理
数据探索和分析
189
有趣!我们的确找到了一个更小的离群值的子集,但是得到了一个奇怪的结果列表:
Mongolia 10.4
India 11.8
Philippines 11.1
查看这个列表时,我们并没有看到数据中的任何最高值或最低值。这意味着,对于识别离
群值来说,数据集并没有遵从正常的统计学规则。
取决于数据集和数据的分布,这两个方法经常会有效地展示出数据的信息。
如果没有的话,就像我们这个数据集,继续搞清楚数据能够告诉我们什么联
系和趋势。
在探索了数据的分布和数据分布所展现的趋势后,你会想要探索数据中的分组关系。下面
这一节解释了怎样对数据分组。
9.1.6
 创建分组
为了进一步研究数据,我们将要创建分组,研究分组之间的关系。
agate
库提供了很多不
同的工具来创建分组,还有其他一些方法来聚合这些分组,确定分组之间的联系。早些时
候,我们的童工数据集中有完好的各大洲数据。让我们尝试从地理角度,按照大洲分组数
据,看一下这样是否会揭露一些与政府腐败数据之间的关系或总结出其他结论。
首先,我们要解决怎样拿到大洲数据的问题。在本书的
git
仓库中(
https://github.com/
jackiekazil/data-wrangling
),我们提供了一个
.json
文件,其中列举了不同大洲包含的国家。
使用这个数据,我们可以添加一列,展示每个国家所属的大洲,以便通过大洲分组。下面
是这一过程的代码:
import
json
country_json = json.loads(open('earth.json', ...
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