特別な名前で列のデータ型を変更する"WIFI"と "BR"で始まる列名を取得してモデリングタイプを "Continuous"に変更するスクリプトを書くのが好きです。belwoのようなもの
現在のデータ表 ();
col_list = dt << 列名を取得する ( "WI-FI" 、 「BR」 ;
col_list << モデリングタイプを設定 ( 「連続」 ;
手伝って頂けますか ?ありがとう
再:列名を特別な名前に変更するあなたが "The Solution"として選んだ回答がその解決策だとは思いません。
再:列名を特別な名前に変更する本当にありがとう。それはうまくいきます。
再:列名を特別な名前に変更する良いキャッチ @txnelson 。 単純な一致以上のものがあるとすれば、私はデフォルトでregexを使います。 したがって、私はさらに別の選択肢を提示します。
dt = Open( "$Sample_data/iris.jmp" );
cols = dt << Get column Names();
for( i = 1, i <= N Items( cols ), i++,
if( !Is missing(Regex( char( cols[i] ) , "^(sepal|width)(.*)", "\0", IGNORECASE) ),
Column( dt, cols[i] ) << Set Modeling Type( "Nominal" );
)
);
再:列名を特別な名前に変更する私は少し自由を取っていますああ JSL 特定の文字列値で「始まる」列名を探していると指定したので、Contains戻り値は1でなければならないことを指定することでこれを保証します。これは値が列1で見つかったことを示します。
dt = Open( "$Sample_data/iris.jmp" );
cols = dt << Get column Names();
for( i = 1, i <= N Items( cols ), i++,
if( contains( uppercase( cols[i] ), "SEPAL" ) ==1 |
contains( uppercase( cols[i] ), "WIDTH" ) == 1
,
Column( dt, cols[i] ) << Set Modeling Type( "Nominal" );
)
);
あなたはまた、私が実際にもっと読みやすいと思う以下の方法論を選ぶかもしれません
Names Default to Here( 1 );
dt = Open( "$Sample_data/iris.jmp" );
cols = dt << Get column Names();
for( i = 1, i <= N Items( cols ), i++,
if( Left( uppercase( cols[i] ), 5 ) == "SEPAL" |
Left( uppercase( cols[i] ), 5 ) == "WIDTH"
,
Column( dt, cols[i] ) << Set Modeling Type( "Nominal" );
)
);
再:列名を特別な名前に変更するたぶんこんな感じ?
Names default to here ( 1 );
dt = Open( "$Sample_data/iris.jmp" );
cols = dt << Get column Names();
for( i = 1, i <= N Items( cols ), i++,
if( contains( uppercase( cols[i] ), "SEPAL" ) |
contains( uppercase( cols[i] ), "WIDTH" )
,
Column( dt, cols[i] ) << Set Modeling Type( "Nominal" );
)
);