实际上,我是来社区的,以查看是否已经有了新的东西,仍然不确定我是否丢失了现在内置的东西...
我想使用JSL将某些值(例如-999或> 998)替换为缺少许多列(可能是所有数字列)。编写脚本并不难。我的意思以及我现在在这里做什么的一个很好的例子:
https://community.jmp.com/t5/Discussions/Deleting-cell-values/td-p/46957
但是(1)这似乎很普遍,因此值得拥有自己的内置功能(或编写重新编码功能的脚本)和(2)不能对大型数据进行快速处理,因此,如果可能的话,可能会有更多资源有效的基础方法可能是这种解决方案的一部分。
如果速度更快,还可以选择数据表下标:
dt = open("$SAMPLE_DATA/Big Class.jmp");
r = loc(dt[0, 4]==61)
dt[r, 4] = .;不久前请求的愿望清单项是将列属性分配给已定义的表组列(列的ist)。
一个非常简单的替代方法是选择需要“清洗”的列。将缺少值的代码属性复制到剪贴板,然后发送JSL消息粘贴多列属性到数据表。随附的脚本显示了一种矩阵方法,该方法无需for循环即可替换值,但是,我发现Missing Values Code更有用:数据库(原始)数据值未修改,可以设置多个值,并且原始值可以被恢复。
Names Default to Here(1);
//create example table
dt = New Table( "example",
Add Rows( 3 ),
New Column( "A",
Character,
"Nominal",
Set Values( {"", "", ""} )
),
New Column( "B",
Character,
"Nominal",
Set Values( {"", "", ""} )
),
New Column( "C",
Character,
"Nominal",
Set Values( {"", "", ""} )
),
New Column( "x_1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 2, 8] )
),
New Column( "x_2",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [8, 8, 8] )
),
New Column( "x_3",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [2, 8, 2] )
),
New Column( "x_4",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [7, 8, 5] )
),
New Column( "x_5",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [2, 8, 3] )
),
New Column( "x_6",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [2, 8, 8] )
),
New Column( "E",
Character,
"Nominal",
Set Values( {"", "", ""} )
)
);
// this replaces values
<STRONG>cnme = dt << get column names(numeric);
dt << select Columns(cnme);</STRONG>
mat = dt << get as matrix;
mat[loc(mat==8)]=empty();
dt[1::nrow(dt),cnme]=mat;
//Close dt and rerun the code to create dt
<STRONG>set clipboard("{Add Column Properties(Set Property(\!"Missing Value Codes\!", {8}))}");
dt << Paste Multi Columns Properties;</STRONG>
//The value of 8 appears, but is treated as missing.
//There is a request that column property settings can be assigned to a column group