"제외 된"행 무시안녕하세요,
나는 여전히 JSL "고비"를 극복하려고 노력하고 있으므로 근본적인 질문을 용서하십시오.
문제:
-샘플 접미사가 a1, a2 및 a3 인 3 개의 복제에 대한 데이터 세트가 포함 된 샘플 테이블이 있습니다.
-때때로 복제 중 하나를 "제외됨"상태로 설정해야합니다 (아래 예는 a2).
-테이블을 열고 제외되지 않은 집합 만 계산에 적용하는 배치 스크립트를 작성하고 있습니다.
-그러나 세 가지 모두의 데이터가 여전히 고려 중이므로 시도 (아래 표시)에는 아직 거기에 있지 않습니다.
-제외되지 않은 행을 식별 한 다음 접미사 검색을 적용하려면 "and"문이 필요할 수 있습니다.
어떤 입력이라도 가장 감사 할 것입니다.
고마워 Neil
states = Current Data Table() << Get Row States();
For( i = 1, i <= N Rows( states ), i++,
rs = As Row State( states[i] );
if (Excluded(rs)==0,
a1 = dt << Get Rows Where(Contains(:Sample,"a1"));
a2 = dt << Get Rows Where(Contains(:Sample,"a2"));
a3 = dt << Get Rows Where(Contains(:Sample,"a3"));
);
)
데이터 테이블Re : "제외 된"행 무시제외 된 행 목록을 반복하지만 매번 동일한 분석을 수행하는 것처럼 보이며 실제로는 제외 된 행 목록을 어디에서나 참조하지 않습니다.다음은 문제를 해결할 수있는 한 가지 방법입니다. 일치하는 행과 제외 된 행을 가져온 다음 목록에서 제외 된 행만 제거합니다.
Names default to here(1);
//Make a sample dataset with some excluded rows
dt = Open("$Sample_data/iris.jmp");
excluded rows to set = [ 4, 9, 52 ];
dt << Select Rows( excluded rows to set );
dt << Exclude(1);
//Find all matching rows and load in associative array, useful for Remove From function later
species matches = associative array(dt << Get Rows Where(:Species == "setosa"));
//get excluded rows
excluded rows = dt << get excluded rows();
//remove excluded rows from the list of rows matching the species
Remove From (species matches, excluded rows);
//get the matching rows as a list
speciesmatches << get keys;Re : "제외 된"행 무시ih,
입력 해 주셔서 감사합니다. 나는 여전히 초보자이지만 Associative Array 개념을 찔렀습니다. 코드가 표시되고 "Get Keys"까지 작동합니다. 그러나 필요한 계산을 수행하기 위해 "speciesmatches"에서 필요한 정보를 가져 오는 방법을 아직 잘 모르겠습니다 (마지막 6 줄 나열). 제외 된 세트를 포함하는 전형적인 테이블의 이미지를 찍었습니다.
Neil
dt = Open( path );
// Find row that were excluded and load into list
Exc_row = dt << Get Excluded Rows;
dt << Select Rows( Exc_row );
dt << Exclude(1);
//Find all matching rows and load in associative array, useful for Remove From function later
species matches = associative array(dt << Get Rows Where(Contains(:Sample,"a1") |Contains(:Sample,"a2") |Contains(:Sample,"a3")));
//get excluded rows
Exc_row = dt << get excluded rows();
//remove excluded rows from the list of rows matching the species
Remove From (species matches, Exc_row);
//get the matching rows as a list
speciesmatches << get keys;
// What needs to be done to get mean of three (or 2 sets in the case of exclusion see table image)
a1 = dt << Get Rows Where(Contains(:Sample,"a1"));
a2 = dt << Get Rows Where(Contains(:Sample,"a2"));
a3 = dt << Get Rows Where(Contains(:Sample,"a3"));<BR />
c1 = Column("Image A pore area (%)");
mean1 = Mean(c1[a1[1]], c1[a2[1]], c1[a3[1]]);
Re : "제외 된"행 무시다음은 홍채 데이터 테이블의 각 종을 살펴보고 해당 기준과 일치하는 행의 평균을 계산하는 업데이트 된 스크립트입니다.즉, 이제 수행중인 작업을 더 잘 이해 했으므로이 문제에 대해 다르게 진행하고 대신 표를 사용하여 해당 값을 찾습니다.
Names default to here(1);
//Make a sample dataset with some excluded rows
dt = Open("$Sample_data/iris.jmp");
excluded rows to set = [ 4, 9, 52 ];
dt << Select Rows( excluded rows to set );
dt << Exclude(1);
species list = {"setosa", "versicolor", "virginica"};
//For each species
for(s=1, s<= n items (species list), s++,
//Find all matching rows and load in associative array, useful for Remove From function later
species matches = associative array(dt << Get Rows Where(:Species == species list[s]));
//get excluded rows
excluded rows = dt << get excluded rows();
//remove excluded rows from the list of rows matching the species
Remove From (species matches, excluded rows);
//get the matching rows as a list, use that to find which rows to average
mn = mean( :Sepal length[speciesmatches << get keys] );
//output averages to the log
write(species list[s] || " mean = " || char(mn) || "\!n")
);
표 형식을 사용하는 옵션 :
Names default to here(1);
//Make a sample dataset with some excluded rows
dt = Open("$Sample_data/iris.jmp");
excluded rows to set = [ 4, 9, 52 ];
dt << Select Rows( excluded rows to set );
dt << Exclude(1);
//New column with the check for each value
New Column("Species_", Character, "Nominal", Formula(If(Contains(:Species, "se"), "se", Contains(:Species, "ve"), "ve", Contains(:Species, "vi"), "vi")));
//tabulate to find averages - script copied from 'source' of data table after selecting
//'make into data table' from tabulate platform, then inserted dt reference
dtTab = (dt << Tabulate(
Set Format( Mean( :Sepal length( 10, 4 ) ) ),
Add Table(
Column Table( Analysis Columns( :Sepal length ), Statistics( Mean ) ),
Row Table( Grouping Columns( :Species_ ) )
)
)) << Make Into Data Table;
//Now get values from the table
dtTab:"Mean(Sepal length)"n[dtTab << Get Rows Where(:Species_ == "se")];Re : "제외 된"행 무시감사합니다!
나는 이것을 시도하고 어떻게 진행되는지 볼 것이다.
원래 의도는 각 세트 (a1, a2 및 a3)에 대해 한 행에서 다공성을 가져와 평균을 구하는 것이 었습니다. 다공성은 각 복제에 대해 동일하지만 3 개의 개별 포인트와 평균 만 추출하는 더 쉬운 방법을 찾을 수 없습니다.
다시 한번 입력 해 주셔서 감사합니다.
Neil
Re : "제외 된"행 무시테이블 플랫폼과 JSL 요약 기능을 확실히 살펴보면 둘 다 상당히 빨리 답을 얻을 수 있다고 생각합니다.