Skip to Content
Python文本分析
book

Python文本分析

by Jens Albrecht, Sidharth Ramachandran, Christian Winkler
August 2022
Intermediate to advanced
441 pages
11h 26m
Chinese
China Electric Power Press Ltd.
Content preview from Python文本分析
16
1
如果不指定参数,则
describe()
只会针对数值列计算总数、均值和标准差,以及
五数概括值(
https://oreil.ly/h2nrN
)。该数据框的
session
year
length
列包含
7507
个记录。统计
year
session
的均值和标准差并没有多大意义,但是最小值和
最大值依然很重要。如上所示,我们的数据集包含从
1970
2015
年、第
25
70
届联合国一般性辩论会议的发言。
如果想生成非数值列的汇总信息,则需要指定
include='O'
'O'
np.object
的别
名)。在这种情况下,我们还可以获得计数、唯一值的个数、出现次数最多的元素
(如果出现的次数相同,则显示其中一个元素)及其频率。由于对于文本数据而言,
唯一值的个数并没有用,所以我们只分析
country
speaker
列:
df[['country', 'speaker']].describe(include='O').T
输出结果:
A summary for nonnumerical columns can be produced by specifying include='O'
(the alias for np.object). In this case, we also get the count, the number of unique
values, the top-most element (or one of them if there are many with the same ...
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

精益AI

精益AI

Lomit Patel
构建知识图谱

构建知识图谱

Jesus Barrasa, Jim Webber
写给系统管理员的Python脚本编程指南

写给系统管理员的Python脚本编程指南

Posts & Telecom Press, Ganesh Sanjiv Naik

Publisher Resources

ISBN: 9787519864446