JSL - 如何迭代雙變數並將所有樣條線儲存到 1 列你好。我創建了一個字串數組,其中包含在我的一列中找到的各種值。 我想為字串數組中的每個值產生一個樣條曲線,並將所有預測點保存到新列中。我能夠迭代 Bivariate(),將每次迭代的 where 子句更改為字串數組中的新值,但是,只有最後的預測點會保存到新列中。如何將所有預測點儲存到新列?謝謝。
Proc = "new";
processArray = {};
DataCV=open("C:\Desktop\JMP\sample_data.csv");
for (l = 1, l < 32521, l++, // Generate array of strings
if (proc == (Row()=l; :process),
print("same process"),
Insert Into(processArray, (Row()=l; :process)); proc = (Row()=l; :process); Show(proc)
);
);
for (n = 1, n <= length(processArray), n++, // Generate and save multiple predicteds
biv = Bivariate(
Y( :c_mm_deembed_pf ),
X( :v_dut_volt ),
Where( :c_type == "Cdg" & :process == processArray[n] ),// :process == processArray[n] appears to be working, as 6 splines are generated
Fit Spline( 0.1, standardized, {save predicteds}) // {save predicteds} is not saving all 6 splines, only last spline
);
); 

回覆:JSL - 如何迭代雙變數並將所有樣條線儲存到 1 列嘗試使用 By() 角色來取得同一列中的所有預測。 這樣就不需要對列表進行迭代,產生的預測公式會自動套用條件語句來分隔副列的不同值。 主要區別在於所有繪圖將共享同一個視窗。
DataCV = Open("C:\Desktop\JMP\sample_data.csv");
DataCV << biv = Bivariate(
Y(:c_mm_deembed_pf),
X(:v_dut_volt),
By(:process),
Where(:c_type == "Cdg"),
Fit Spline(0.1, Standardized, {Save Predicteds})
);回覆:JSL - 如何迭代雙變數並將所有樣條線儲存到 1 列@tx尼爾森,
哎呀。 我沒有看到後來的帖子,而是使用 Eval Expr 而不是 Substitute 回答了先前的問題。
我無意重複回覆。
抱歉,吉姆。
回覆:JSL - 如何迭代雙變數並將所有樣條線儲存到 1 列而且,我只是再次考慮了“預測”列的“預測”公式,並意識到您正在使用的過程將在處理時相互寫入。我建議您在每次執行二元變數後重命名 Prediced 列,強制每次迭代最終建立一個新列。
回覆:JSL - 如何迭代雙變數並將所有樣條線儲存到 1 列這是腳本的帶註解的修改版本。試試看。我相信它會與您的數據一起使用。我無法真正做好測試,但任何錯誤都應該很小
Names Default To Here( 1 );
Proc = "new";
processArray = {};
DataCV = Open( "C:\Desktop\JMP\sample_data.csv" );
// In the commented area is a reworked version of your code that I believe
// simplifies the syntax of what you were doing. Please review it and see
// what changes I made.
/*for (l = 1, l <= N Rows(DataCV) , l++, // Generate array of strings
if (proc == :process[l],
print("same process")
,
Insert Into(processArray, :process[l]);
proc = :process[l];
Show(proc)
);
);*/
// The summarize() function is a much faster way to get the values found for
// a spcific column or combination of columns
Summarize( DataCV, processArray = By( :process ) );
For( n = 1, n <= Length( processArray ), n++, // Generate and save multiple predicteds
// I found that using a JSL variable in the where clause was having issues, because the formula
// created for the Predicted values contains a reference to PredictedArray, which JSL Variable can change,
// which makes the formula invalid. So what needs to be done, is to subsitute the actual value for
// predictedArray[n] into the Where Clause
Eval(
Substitute(
Expr(
biv = Bivariate(
Y( :c_mm_deembed_pf ),
X( :v_dut_volt ),
Where( :c_type == "Cdg" & :process == __process__ ), // :process == processArray[n] appears to be working, as 6 splines are generated
Fit Spline( 0.1, standardized, {save predicteds} ) // {save predicteds} is not saving all 6 splines, only last spline
)
),
Expr( __process__ ), processArray[n]
)
)
);