如何删除显示相同值的列我想删除所有行都显示相同值的列。因此,我首先创建这些列的列表(范围== 0)。当我运行脚本时,一切正常,直到删除列。 JMP显示可编写脚本,但不会删除。
names default to here (1);
dt = current data table ();
for (i= n col (dt), i >= 1, i--,
if( (col N missing (column (i)) / N Rows() ) > 0.8,
dt << delete columns (i)
)
);
ColList1 = dt << get column names(continuous);
dt << summary(
range(eval(ColList1)),
output table("range")
);
Empty = {};
ColList = data table("range") << get column names(continuous);
for(i=1,i<=n items(ColList),i++,
col = column(ColList[i]);
if(col[1] ==0, insert into(Empty,ColList[i]))
);
dt << delete columns(Empty);脚本编写回复:如何删除显示相同值的列在“ col”变量上使用下标存在问题。
col = column(ColList[i]);
这会将变量“ col”设置为缩放器。
if(col[1] ==0, insert into(Empty,ColList[i]))
尝试将其引用为列表col [1]。 如果更改为:
if(col ==0, insert into(Empty,ColList[i]))
它应该解决这个问题