セルを読み書きするためのより速い方法こんにちは
電子集積回路装置(IC)からの生産データを含むビッグデータファイル(250k行×2k列)があります。
そして私は結果を評価してデータのパターンを探すのに使うjslスクリプトを持っていますが、そのような大きなデータテーブルでは実行を完了するのに数時間かかります。
私が使っていたセルを読み書きするために dt:MeasureX [行] しかし、その命令は実行効率が良くないように思われるので、私は Column(dt、"MeasureX")[intRow] これは実行速度が20%速いということです。
実行時間を短縮するためのトリックはありますか?スクリプトの実行中にテーブルウィンドウの更新を停止するのと同じように...
ありがとう
再:セルを読み書きするためのより速い方法 @oscarmforero 、
あなたのデータは数値なので。マトリックス上でほとんどのアクションを試して実行する方がかなり速いでしょう。
dt = Current Data Table();
Mat = dt << Get As Matrix; // fetches all numeric data as a matrix
行列を作成したら、論理条件に基づく選択にloc()を使用できます。これはより詳細な例です:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// Get as Matrix
Mat = dt << Get as Matrix; // Note Matrix will only be 3 columns
// Selecting data in data table
SR = dt << Select Where(:height <= 65) << Get Selected Rows;
dt[SR,"height"] = 65;
dt << Clear Select;
// Selecting data in matrix
SR1 = Loc(Mat[0,2] <= 65);
Mat[SR1,2] = 65;
再:セルを読み書きするためのより速い方法ハイマーク
例えば、以下のコード(実行に時間がかかるもの)を持っています。ここでループを使用してセルを読み取り、それらの値をそれらの仕様限界と比較するために使用します。セル値が制限を超えている場合は、異なるセルの値を読み取って上書きします。
numDataColumns = Current Data Table() << get column names( Numeric );
main_table = Current Data Table();<BR />
//Loop all columns with parametric data
For( intCol = 1, intCol <= N Items( numDataColumns ), intCol++,
Spec_Lims = Column( numDataColumns[intCol] ) << Get Property( "Spec Limits" );
Spec_USL_num = Try( Spec_Lims["USL"], . );
Spec_LSL_num = Try( Spec_Lims["LSL"], . );
USL_exist = Is Missing( Spec_USL_num ) == 0;
LSL_exist = Is Missing( Spec_LSL_num ) == 0;
//Loop all the selected rows (fails) and count the number of parametric fails and executed tests.
For( intRow = 1, intRow <= N Rows( Data Table( main_table ) ), intRow++,
If( Selected( Row State( Data Table( main_table ), intRow ) ) > 0,
If( Is Missing( Column( main_table, numDataColumns[intCol] )[intRow] ) == 0, //Only check for cells with data
//If both spec limits are available
If(
(USL_exist == 1 & LSL_exist == 1) & (Column( main_table, numDataColumns[intCol] )[intRow] > Spec_USL_num |
Column( main_table, numDataColumns[intCol] )[intRow] < Spec_LSL_num),
Column( main_table, "parFailCount" )[intRow] = Column( main_table, "parFailCount" )[intRow] + 1;<BR /> //log names of failing tests
Column( main_table, "failListNames" )[intRow] = Column( main_table, "failListNames" )[intRow] || Char( numDataColumns[intCol] )
|| ",";
);
//Considered only as executed tests when any of the limits are available.
If( USL_exist == 1 | LSL_exist == 1,
Column( main_table, "parExecutedTests" )[intRow] = Column( main_table, "parExecutedTests" )[intRow] + 1
);
)
)
);
);再:セルを読み書きするためのより速い方法スクリプトのパフォーマンスを向上させる方法は多数ありますが、その方法はスクリプト内のアクションによって異なります。スクリプトが何をするのか説明してください」 結果を評価し、データ内のパターンを探す 「」