cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

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

Recode - Parse as Numbers

Why does Recode not show a warning when a user uses the  "parse as number" option?

hogi_0-1730271084348.png

3 REPLIES 3
jthi
Super User

Re: Recode - Parse as Number

What type of warning it should show?

-Jarmo
hogi
Level XIII

Re: Recode - Parse as Number

Something like: 
"your data table contains many rows - don't use Parse as Number in combination with any other option to update the input column!"

 

recode and change to numeric64s
recode2.8s
For each row1.3s
recode and change to numeric -> new column2.9s
just: change to numeric0.06s

 

View more...
Names Default To Here( 1 );
dt = New Table( "test",
	add rows( 1000000 ),
	New Column( "rw1", Character, set each value( "row " || Char( Row() ) ) ),
	New Column( "rw2", Character, set each value( "row " || Char( Row() ) ) ),
	New Column( "rw3", Character, set each value( "row " || Char( Row() ) ) ),
	New Column( "rw4", Character, set each value( "row " || Char( Row() ) ) ),
	New Column( "rw5" ),
	New Column( "rw6" )
	
);


t0 = HP Time();
dt << Begin Data Update;
dt << Recode Column( dt:rw1, {Substitute( _rcNow, "row", "" ), Num( _rcNow )}, Update Properties( 1 ), Target Column( :rw1 ) );
dt << End Data Update;
time = (HP Time() - t0) / 1000000;
Print( "recode and change to numeric" );
Show( time );


t0 = HP Time();
dt << Begin Data Update;
dt << Recode Column( dt:rw2, {Substitute( _rcNow, "row", "" )}, Update Properties( 1 ), Target Column( :rw2 ) );
dt << End Data Update;
dt:rw2 << Set Data Type( Numeric );
time = (HP Time() - t0) / 1000000;
Print( "recode" );
Show( time );

t0 = HP Time();
dt << Begin Data Update;
For Each Row( dt, dt:rw3[] = Substitute( dt:rw3, "row", "" ) );
dt << End Data Update;
dt:rw3 << Set Data Type( Numeric );
time = (HP Time() - t0) / 1000000;
Print( "For each row" );
Show( time );


t0 = HP Time();
dt << Begin Data Update;
dt << Recode Column( rw4, {Substitute( _rcNow, "row", "" ), Num( _rcNow )}, Update Properties( 1 ), Target Column( :rw5 ) );
dt << End Data Update;
time = (HP Time() - t0) / 1000000;
Print( "recode and change to numeric - new column" );
Show( time );

t0 = HP Time();
dt << Begin Data Update;
dt << Recode Column( rw6, {Num( _rcNow )}, Update Properties( 1 ), Target Column( :rw6 ) );
dt << End Data Update;
time = (HP Time() - t0) / 1000000;
Print( "just: change to numeric" );
Show( time );

 

hogi
Level XIII

Re: Recode - Parse as Number

and:


Recode shows a live preview - even for table with a large numbers of rows.

Optimize your settings with a subset table and apply the resulting script to the main table.

Recommended Articles