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
hogi
Level XII

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 XII

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 XII

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.