cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar

select all the excluded cols, then delete?

I'm working with a script that's doing some big data analysis on dt's with 10k+ cols. some of my first passes for screening these features results in excluding ~90% of the cols for further deeper analysis. In the interest of tidying up and reducing the dt, I want to select all the excluded cols and delete them. Any tips on how to script this?

 

In my script, I am generating a colsList that is the 'keeper' cols to use in later analysis, and I know there's the 'invert column selection' option in the menu drop downs. How do I script it to select all the excluded cols then delete? Ideally I'd like to select the excluded cols rather than inverting my colsList, because that only is the features columns, and does not include all the context key columns.

1 REPLY 1
txnelson
Super User

Re: select all the excluded cols, then delete?

Welcome to the Community.

Here is the example of inverting the column selection from the Scripting Index

txnelson_0-1724372475459.png

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt:age << Set Selected( 1 );
dt:height << Set Selected( 1 );
Wait( 1 );
b = dt << Invert Column Selection;

And here is the example of how to delete selected columns from the Scripting Index

txnelson_1-1724372583190.png

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt:height << Set Selected;
Wait( 2 );
dt << Delete Columns();

As you can see, the Scripting Index is really a powerful learning tool and syntax reference.  

 

 

 

 

Jim