大家好,
我有一个函数,当且仅该列不为空时,我需要它运行。如何正确检查该列是否不为空并运行该函数,我尝试了 isMissing() 但无法正常工作。
示例函数:
exsqr = Function( {x}, x * x );
exsqr( 5 );
所以它看起来像这样:
exsqr0; //函数1
if (isMissing(Column1), //如果 Column1 有值,则应该运行该函数,否则,跳过该函数并继续执行 function3
前); //函数2
exsqr1; //函数3
你可以使用N 列缺失结合N行或者栏号检查除了缺失值之外是否还有其他内容。 以下是一些想法:
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(3),
New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([., ., .])),
New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([1, ., 3]))
);
Show(Col N Missing(:Column 1));
Show(Col N Missing(:Column 2));
If(N Rows(dt) - Col N Missing(:Column 1) > 0,
Show(:Column 1 << get values);
);
Show(Col Number(:Column 1));
Show(Col Number(:Column 2));
If(Col Number(:Column 2) >= 0,
Show(:Column 2 << get values);
);