Min and Max values of all numeric columnsI am trying to extract minimum and maximum values from all numeric columns of a table. However, I also want the column name of which the values are extracted.
Here is my script:
dt = Open("Path");
nc = N Row(dt);
mycol = dt << get column names;
//show(mycol);
for(i=1,i<=nc,i++,
If( x = Column( dt, i ) << get data type() == "Numeric",
myMax = col max(column(dt,i));
print("Max:",myMax);
myMin = col min(column(dt,i));
print("Min",myMin);
));
I also get the following JMP Alert when I run this script:
Check script for using an assignment with single = where a test for equality with double == is normally expected. Expression is
"x = Column( dt, i ) << get data type() == "Numeric""
However, I am able to extract the min and max values. Can anyone point out as to how I can extract the names of those numeric columns as well and put that in a new table with Column Name, Min and Max values? Thanks.
Re: Min and Max values of all numeric columnsFor a non-JSL solution...
- From the columns red triangle in the colmns panel (left side of data table) select "Column Viewer".
- Select the columns of interest
- Click on the "Show Quartiles" option
- Click Show Summary
- From the Summary Statistics red triangle menu select "Data Table View"
- Delete the columns you do not want.
- Done.
Re: Min and Max values of all numeric columns@powerpuff,
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
NumericCols = {};
Minimums = {};
Maximums = {};
for(i = 1, i <= N Cols(dt), i++,
Col = Column(dt,i);
ColDataType = Col << Get Data Type;
If( ColDataType == "Numeric",
Insert Into(NumericCols,Col << Get Name);
Insert Into(Minimums, Col Min(Col));
Insert Into(Maximums, Col Max(Col));
);
);
Show(NumericCols);
Show(Minimums);
Show(Maximums); Re: Min and Max values of all numeric columnsTry this one
Names Default To Here( 1 );
dt = Open( "path" );
For( i = 1, i <= N Col( dt ), i++,
If( Column( dt, i ) << get data type == "Numeric",
Write( "\!n", Column( dt, i ) << get name );
Write( Column( dt, i ), "\!nMin: ", Col Min( Column( dt, i ) ) );
Write( "\!nMax: ", Col Max( Column( dt, i ) ) );
)
);