是否有一個 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;
然後你就可以像群體一樣操縱它們