Re:循環錯誤以使數值列標準化指定公式值時,它不會對公式的JSL進行任何評估。 相反,它只是將代碼移動到公式中。 那麼,公式中的內容是“ Col標準化 ( : numericColNames [ 一世 ] ) “不是,” Col標準化 ( : YourColumnName )“。 因此,當執行公式時,它將查找“i”的值,當它執行時,它已經移動了beyone你的Colnames的下標範圍。 因此,需要做的是將公式的精確JSL語法放入公式中。
Names Default To Here( 1 );
dt = Current Data Table();
numericColNames = dt << get column names( string, numeric );
For( i = 1, i <= N Items( numericColNames ), i++,
Eval(
Substitute(
Expr(
New Column( Char( numericColNames[i] ) || "_Stand",
Numeric,
Continuous,
Formula( Col Standardize( __col__ ) )
)
),
Expr( __col__ ), Parse( ":" || numericColNames[i] )
)
)
);循環錯誤標準化數字列你好。我編寫了一個腳本來創建從公式到標準化的新數值列,但在評估公式時我得到一個錯誤。我做錯了什麼?
謝謝。
劇本:
Names Default To Here( 1 );
dt = Current Data Table();
numericColNames = dt << get column names( string, numeric );
For( i = 1, i <= N Items( numericColNames ), i++,
New Column( Char( numericColNames[i] ) || "_Stand",
Numeric,
Continuous,
Formula( Col Standardize( :numericColNames[i] ) ) )
);
錯誤:
Name Unresolved: numericColNames 1 times At rows: {1} Operation: numericColNames, :numericColNames
Re:循環錯誤以使數值列標準化親愛的先生,我有一張小桌子可以試試。它由一個列為城市名稱的列組成(1900),其整數值對應於1900年的總體,另一列以百分比表示。 當我嘗試scritp時,我發現,雖然指令“numericColNames = DT << 獲取列名稱 ( 串 ,數字 ) ; “在創建兩個新列時,將col 1900和”Percentage Canvi“識別為數字,對應於1900的列使其具有缺失值。
Re:循環錯誤以使數值列標準化像1900這樣的列名可能會混淆JMP,因為它可能不知道它是否應該將其視為數字或列名。 因此,需要通過使用:Name()函數明確指出它是列名...請參閱下面的重寫腳本
Names Default To Here( 1 );
dt = Current Data Table();
numericColNames = dt << get column names( string, numeric );
numericColNames = {"1900"}
For( i = 1, i <= N Items( numericColNames ), i++,
Eval(
Substitute(
Expr(
New Column( Char( numericColNames[i] ) || "_Stand",
Numeric,
Continuous,
Formula( Col Standardize( __col__ ) )
)
),
Expr( __col__ ), Parse( ":Name(\!"" || numericColNames[i] || "\!")" )
)
)
);Re:循環錯誤以使數值列標準化先生,你似乎對一切都有答案。再次感謝您的貢獻!