是否有一个 JSL 命令可以将我的数据表顶部的所有排除行分组?您好 - 我无法找到 JSL 命令来对数据表顶部的所有排除行进行分组。这可能吗?
数据混合和清理回复:是否有一个 JSL 命令可以将我的数据表顶部的所有排除行分组?谢谢罗恩。轻微按摩后效果非常好。我很感激。这就是我最终得到的结果。
dt = Open(
"C:\Users\trcampbell\Desktop\ECOLI\share ecoli data\for Rachel\092921 MODEL\092921 n=205.jmp",
window bounds( 217, 221, 1622, 1057 )
);
Random_rows = dt << Select Randomly( 0.2 ) << Hide and Exclude();
New Column( "Excluded", Numeric, "Continuous", Format( "Best", 12 ) );
:Excluded << Set Formula( If( Excluded(), 1, 0 ) );
dt << Sort( By( :Excluded ), Replace Table, Order( Descending ), Copy formula( 0 ) );
Close(
dt,
save(
"C:\Users\trcampbell\Desktop\ECOLI\share ecoli data\for Rachel\092921 MODEL\test 10 - 092921.jmp"
)
);
回复:是否有一个 JSL 命令可以将我的数据表顶部的所有排除行分组?谢谢马克。从这里到达那里有多种方式!
回复:是否有一个 JSL 命令可以将我的数据表顶部的所有排除行分组?这是另一种方法。
Names Default to Here( 1 );
// example
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// exclude some rows like a user might
excluded = J( 5, 1, Random Integer( 1, N Row( dt ) ) );
dt << Select Rows( excluded ) << Exclude( 1 ) << Clear Select;
Wait( 2 );
// actual solution:
// select excluded rows
excluded = dt << Get Excluded Rows;
dt << Select Rows( excluded );
// move selected rows to top of data table
dt << Move Rows( At Start ) << Clear Select;
回复:是否有一个 JSL 命令可以将我的数据表顶部的所有排除行分组?非常感谢。效果非常好。我很感谢你的帮助,txnelson。
回复:是否有一个 JSL 命令可以将我的数据表顶部的所有排除行分组?你好@learning_JSL
看看你是否可以使用这个例子:
/*:
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "/C:/Program Files/SAS/JMPPRO/14/Samples/Data/Big Class.jmp" );
// Toggle selected rows' hide and exclude states
Data Table( "Big Class" ) << Select Randomly( Sampling Rate( 0.1 ) ) <<
Hide and Exclude;
// New column: Excluded
Data Table( "Big Class" ) << New Column( "Excluded",
Numeric,
"Continuous",
Format( "Best", 12 )
);
// Column formula: Excluded
:Excluded << Set Formula( If( Excluded(), 1, 0 ) );
// Sort data table
Data Table( "Big Class" ) << Sort(
By( :Excluded ),
Replace Table,
Order( Descending ),
Copy formula( 0 )
);
让我们知道它是否有效
回复:是否有一个 JSL 命令可以将我的数据表顶部的所有排除行分组?这是我的第一个脚本的简单扩展,它对行进行重新排序
Names Default To Here( 1 );
dt = Current Data Table();
ex = dt << get excluded rows;
dt << New Column( "__row__", set each value( Row() ) );
dt << New Column( "__exclude__" );
dt:__exclude__[ex] = 1;
dt << sort( by( :__exclude__, :__row__ ), order( descending, ascending ), replace table( 1 ) );
dt << delete columns( {"__row__", "__exclude__"} );回复:是否有一个 JSL 命令可以将我的数据表顶部的所有排除行分组?或者也许还有另一种使用 JSL 的方法?目标是将所有排除的行分组在一起,作为验证测试过程的一部分。(我正在使用未排除的行训练我的模型,并使用排除的行对其进行测试......因此需要在数据表中的一处轻松访问和查看排除的行。否则它们会在整个数据集中混合在一起。)我需要多次重复此步骤,这就是我需要编写脚本的原因。
回复:是否有一个 JSL 命令可以将我的数据表顶部的所有排除行分组?我处理这个问题的方法是创建一个排除行号的矩阵。
Names Default To Here( 1 );
dt = Current Data Table();
ex = dt << get excluded rows;
然后你就可以像群体一样操纵它们