Choose Language Hide Translation Bar
Highlighted
FN
FN
Level V

Python Send() skips NaN values when single column is sent

I believe I found an inconsistent behavior when sending datatables to pandas dataframes (Python).

 

I would expect that if columns have missing values, these are passed as NaN to pandas dataframes.

 

Yet, this is only true if more than one column is sent, otherwise Pythons only receives non missing values.

 

ClearLog();

dt = Open( "$SAMPLE_DATA/Bands Data.jmp");
Explore Missing Values( Y( :caliper, :viscosity ), Missing Value Report );

x1 = dt << Subset(
			Allrows,
			Columns(:caliper)
			);
			
x2 = dt << Subset(
			Allrows,
			Columns(:caliper, :viscosity)
			);



Python Init();
Python Send( x1 ); // send the opened data table represented by dt to Python
Python Send( x2 ); // send the opened data table represented by dt to Python

Python Submit( "
print('x1:', len(x1))
print('x2:', len(x2))
" );
Python Term();

// Output:
// x1: 512
// x2: 539