你好,
I have the following input data table, attached input_table.jmp, which is treated by my script, see below or attached 導入後分析腳本.jsl. I want to convert col 1 (character, nominal, input format "
-
/
<MM>
/
<YY>
<HH>
:
<MM>
:
<SS>
"
</SS>
</MM>
</HH>
</YY>
</MM>) to Date (numeric, continuous, output format
"
-
.
<MM>
.
<YY>
<HH>
:
<MM>
:
<SS>
"
</SS>
</MM>
</HH>
</YY>
</MM>). However if I use my script then the conversion is wrong in the rows from 2656 to 2657,
。它將其轉換為
"
<MM>
.
</MM>
-
.
<YY>
<HH>
:
<MM>
:
<SS>
"
</SS>
</MM>
</HH>
</YY>
從第 2657 行開始。因此第 2656 行到第 2657 行之間的持續時間是一個月,而不是 10 秒。請查看附件 bugged.jmp 中的錯誤資料表
知道這裡出了什麼問題嗎?
我正在使用 Windows 10、JMP 18 以及 JMP 18 Pro。
謝謝!
腳本:
dt = Current Data Table();
// Column configuration
dt << Begin Data Update;
// Rename and configure columns using column numbers
Column(dt, 1) << Set Name("Date")
<< Data Type(Numeric)
<< Modeling Type("Continuous")
<< Format("Format Pattern", "
.
<MM>
.
<YY>
<HH>
:
<MM>
:
<SS>
", 17, 0 ) << Input Format( "Format Pattern", "
</SS>
</MM>
</HH>
</YY>
</MM>
-
/
<MM>
/
<YY>
<HH>
:
<MM>
:
<SS>
", 0 ); Column(dt, 2) << Set Name("minutes") << Formula((:Date-:Date[1]) / 60) << Format("Best", 12); Column(dt, 3) << Set Name("Temperature 1 [°C]"); Column(dt, 4) << Set Name("Temperature 2 [°C]"); Column(dt, 7) << Set Name("Target Temperature 1 [°C]"); Column(dt,
8)</img> << Set Name("Target Temperature 2 [°C]"); // Remove unused columns dt << Delete Columns({"Col 5", "Col 6"}); dt << End Data Update; // Set display properties dt << Set Display Width("Date", 180); dt << Set Display Width("minutes", 50); dt << Set Display Width("Temperature 1 [°C]", 50); dt << Set Display Width("Temperature 2 [°C]", 50); Graph Builder( Size( 1239, 816 ), Variables( X( :minutes ), Y( :"Temperature 1 [°C]"n ) ), Elements( Points( X, Y, Legend( 7 ) ), Smoother( X, Y, Legend( 9 ), Method( "Local Kernel" ), Lambda( 0.000001 ), Local Width( 0.1284 ) ) ) );
</SS>
</MM>
</HH>
</YY>
</MM>
自動化和腳本視窗
我認為該問題可能是因為您正在連結格式化訊息而發生的。變更為數字將在輸入格式之前發生,而輸入格式將在格式之前發生 -> JMP 將決定列變更為數字時要使用的格式。您可以重新排序它們或同時發送它們,特別是那些與資料類型相關的。
而不是
使用類似
Column(dt, 1) << Set Data Type(
Numeric,
Input Format("Format Pattern", "
/
<MM>
/
<YY>
<HH>
:
<MM>
:
<SS>
", 0), Format("Format Pattern", "
</SS>
</MM>
</HH>
</YY>
</MM>
.
<MM>
.
<YY>
<HH>
:
<MM>
:
<SS>
", 17, 0) ) << Set Modeling Type("Continuous") << Set Name("Date");
</SS>
</MM>
</HH>
</YY>
</MM>
Column(dt, 1) << Set Name("Date")
<< Data Type(Numeric)
<< Modeling Type("Continuous")
<< Input Format( "Format Pattern", "
<DL><DD>
/
<MM>
/
<YY>
<HH>
:
<MM>
:
<SS>
", 0 ) << Format("Format Pattern", "
</SS>
</MM>
</HH>
</YY>
</MM>
</DD>
<DD>
<CODE class=" language-jsl">.
<MM>
.
<YY>
<HH>
:
<MM>
:
<SS>
", 17, 0 );
</SS>
</MM>
</HH>
</YY>
</MM>
感謝您的快速回覆!
我了解這個問題並且您建議的解決方案有效。
謝謝!