Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
279 views
in Technique[技术] by (71.8m points)

怎么让整个表格的null都变为0

nullFill好像不支持整个表格。如果要让整个表格的null都变为0,是不是只能用loop/each:

loop(def(tab,col){tab[col].nullFill!(0)}{tab_res}, tab_res.colNames())

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

DolphinDB从1.00.2版本起,除了vector和matrix,nullFill!,bfill!,ffill!,lfill!可以接受内存表作为输入参数,支持对整表所有列替换null值。
对之前的版本,可以

loop(nullFill{,0}, t.values()).table().rename!(t.colNames())

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...