cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
lala
Level IX

在脚本中如何用列号来代替列名称?

 例如: 以下脚本是选取年龄是13岁的姓名、身高、体重列数据

 

在脚本中如何表示 用第4列、第5列来分别代替"身高"、"体重"列?

感谢帮助!

2021-09-13_220141.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

回复: 在脚本中如何用列号来代替列名称?

You can use the Column() function

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( age == 13 );
dt << Select Columns( "name", "height", "weight" );
d3 = dt << Subset( Output Table( "A" ), Selected Rows( 1 ), columns( column(4), column(5) ));
Jim

View solution in original post

lwx228
Level VIII

回复: 在脚本中如何用列号来代替列名称?

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( age == 13 );
c1 = Column( 1 ) << Get Name;
c2 = Column( 4 ) << Get Name;
c3 = Column( 5 ) << Get Name;
dt << Select Columns( c1, c2, c3 );
d3 = dt << Subset( Output Table( "A" ), Selected Rows( 1 ), columns( Column( 1 ), Column( 4 ), Column( 5 ) ) );

View solution in original post

4 REPLIES 4
lala
Level IX

回复: 在脚本中如何用列号来代替列名称?

jsl

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( age == 13 );
dt << Select Columns( "name", "height", "weight" );
d3 = dt << Subset( Output Table( "A" ), Selected Rows( 1 ), columns( name, height, weight ) );
txnelson
Super User

回复: 在脚本中如何用列号来代替列名称?

You can use the Column() function

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( age == 13 );
dt << Select Columns( "name", "height", "weight" );
d3 = dt << Subset( Output Table( "A" ), Selected Rows( 1 ), columns( column(4), column(5) ));
Jim
lala
Level IX

回复: 在脚本中如何用列号来代替列名称?

dt << Select Columns( "name", "height", "weight" );

Could the  "height and weight" in this line of code also be replaced with column numbers?

 

Thanks Experts!

lwx228
Level VIII

回复: 在脚本中如何用列号来代替列名称?

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( age == 13 );
c1 = Column( 1 ) << Get Name;
c2 = Column( 4 ) << Get Name;
c3 = Column( 5 ) << Get Name;
dt << Select Columns( c1, c2, c3 );
d3 = dt << Subset( Output Table( "A" ), Selected Rows( 1 ), columns( Column( 1 ), Column( 4 ), Column( 5 ) ) );

Recommended Articles