Skip to Content
Tableau Prep即学即用
book

Tableau Prep即学即用

by Carl Allchin
August 2022
Beginner to intermediate
463 pages
9h 22m
Chinese
China Electric Power Press Ltd.
Content preview from Tableau Prep即学即用
245
空值处理
27
-
5
:数据集中有零值时所产生的平均值
那么,这种情况下的数学原理是什么,为什么结果会有所不同呢?好吧,为了计算
平均值,
Prep Builder
是将
Volume
(数量)相加,然后除以行数。对于这两张表,
条形皂的数量之和是
170
,液体皂的数量之和是
1700
。但是,
Prep Builder
不计算
包含空值的行数。这意味着,对于没有空值的表格,数量之和被
4
所除(因为每种
类型的肥皂都有四行);但对于有空值的表格,数量之和只被
3
所除(因为每种类
型的肥皂只有三个非空值)。
这是需要考虑的很重要的一点,因为如果空值状态是正常的(即没有空值记录以及
不应该出现的记录),那么相应数据字段中的记录数就没问题。但是,如果仅仅是
由于某个值在应该记录的时候没有被记录,导致记录中出现了空值,那么此时空值
字段就应该用数字零代替。当一个产品在商店里有存货但没有卖出时,就会出现这
样的情况。因此,空值应该用于产品在某个商店内没有库存,并且从来没有被销售
的可能这种情况。
27.3
如何删除或替换空值
作为一个数据准备者,你可能不得不决定
null
(空值)不允许留在你的数据集中。
在这种情况下,你有几个选择:
27.3.1 ISNULL()
函数
如果你的数据分析过程不允许出现空值,你可能需要过滤掉这一行。
ISNULL()
是一
个神奇的函数,它允许你简单地评估一条记录在给定字段中是否有空值。
ISNULL()
246
27
返回一个
True
(真)或
False
(假)的布尔结果,所以你可以只过滤掉
True
值记录,
从而删除空值(见图 ...
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

深度学习:核心原理与案例分析

深度学习:核心原理与案例分析

Posts & Telecom Press, Ahmed Menshawy
Python金融实战

Python金融实战

Posts & Telecom Press, Yuxing Yan
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu
HBase管理指南

HBase管理指南

Posts & Telecom Press, Yifeng Jiang

Publisher Resources

ISBN: 9787519864439