過濾不在給定範圍內的行值 (JSL)我正在嘗試自動化一些資料清理。 我有每列被認為有效的下限值和上限值,並且我想刪除最後有空值的所有其他內容。 我失蹤了:
- 選擇後如何清除行值。
- 如何引用列名
- 如果有更好的辦法的話。
Names Default To Here( 1 );
dt = Current Data Table();
lower_limit = 69.636;
higher_limit = 71.482;
sel = dt << Select Where( :my_column_name>= lower_limit &
:my_column_name<= higher_limit );
sel << Invert Row Selection;
// clear rows (sel)??
/*
// Here I am trying to do the same but referencing the column. Yet it does not work.
mycol = Column("my_column_name"); // this does not work
mycol = :my_column_name; // this does not work either
sel = dt << Select Where( mycol >= lower_limit &
mycol <= higher_limit );
*/
回覆:過濾不在給定範圍內的行值 (JSL)謝謝,這就是我一直在尋找的。
不過,我的表中有此訊息:嘗試分配給鎖定的列黴菌。
回覆:過濾不在給定範圍內的行值 (JSL)您是否想要將該列中的值替換為空,或者是否想要刪除這些行?
Names Default To Here( 1 );
dt = Open("$sample_data/big class.jmp");
lower_limit = 70;
higher_limit = 150;
mycol = Column("weight");
sel = dt << Get Rows Where ( mycol[] < lower_limit |
mycol[] > higher_limit );
mycol[sel]= empty();
//to delete rows use
// dt << delete rows(sel);
回覆:過濾不在給定範圍內的行值 (JSL)太好了,我怎麼能刪除該特定選擇(行和列)的值?
回覆:過濾不在給定範圍內的行值 (JSL)您應該查找 Function As Column()。 如果要使用列值,語法是ref_name[],即左括號,右括號。嘗試下面的語法。
sel = dt << Select Where( mycol[] >= lower_limit &
mycol[] <= higher_limit );