Skip to Content
深入浅出数据分析
book

深入浅出数据分析

by Michael Milton
June 2023
Beginner to intermediate
485 pages
9h 43m
Chinese
Publishing House of Electronics Industry
Content preview from 深入浅出数据分析
13 整理数据 井然有序 409
让我们通过排序更仔细地看看名单中的重复情况。
在R中,通过子集括号中的order函数可以对数据框
架排序。执行下列指令:
由于PersonID域有可能是代表每一个人的特定编号,用它排序再好
不过。毕竟,这些数据中可能不止一个叫做“JohnSmith”的人。
下面,执行head指令看看生成的结果:
hfhhSorted <- hfhh[order(hfhh$PersonID), ]
head(hfhhSorted, n=50)
排序得出的新名单。排序得出的新名单。
为数据排序,让重复
数值集中出现
如果数据量很大,则发现重复数值颇
为不易,给名单排个序的话就容易多了。
Alex
Stu
Sara
Greg
Chris
Jen
Jorge
未排序
Alex
Alex
Alex
Ben
Chris
Chris
Dee
排序
发现这份名单中的重复发现这份名单中的重复
情况颇为不易,尤其是情况颇为不易,尤其是
在名单较长的情况下。在名单较长的情况下。
这儿有大量重复。这儿有大量重复。
很容易看出很容易看出
重复情况。重复情况。
R做了什么?
整理数据
练习
410 深入浅出数据分析
t
用R按照PersonID对数据框架排序后,发现有重复数据吗?
呀!好多重复的呀!好多重复的
名字啊,真乱!名字啊,真乱!
若手头数据非常混乱,就应该大胆地排序 ...
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

数据驱动力:企业数据分析实战

数据驱动力:企业数据分析实战

Carl Anderson
Python算法交易实战

Python算法交易实战

Posts & Telecom Press, Sebastien Donadio
Python数据处理

Python数据处理

Jacqueline Kazil, Katharine Jarmul

Publisher Resources

ISBN: 9787121451683