Python Script node LookupError: No serializer extension having the id or processing python type "float32" could be found.

Hi,

I was using Python (option 3) Script Node (1=>1), with Knime 3.5.1(2). I got the following error when I can execute node the script to write out the output_table:

ERROR PythonKernel                    LookupError: No serializer extension having the id or processing python type "float32" could be found.
ERROR Python Script (1⇒1)  0:11       Execute failed: An exception occured while running the python kernel. See console and log for details.

While I run the script itself,it was OK.

>>print(output_table.head(5))

   identifier  C1  C2
0  3129492592   -35.313061   -25.036938
1  4214068905     3.753983    32.609692
2  3632350815   -18.974716    11.444963
3  3798139026     4.219767    31.726084
4  1257718710   -23.482515    -8.016854

If I don't include the two floating columns C1 and C2, there is no problem.

I have attached some related log file.

Thank you in advance for help!

Toushi68

Hey Toushi68,

the reason your float columns cannot be transferred from python to KNIME is that KNIME only supports double types (float64) and an implicit conversion from float32 to float64 is not implemented. What you can do in order to solve your problem is adding

output_table.loc[:,['C1','C2']].astype('float64', copy=False)

at the end of your script.

I hope I could help you, if you have any further questions do not hesitate to ask.

Best,

Clemens

Hi Clemens,

Thank you for the suggestion, following the direction I found out this one making Knime happy!:

output_table['C1'] = df_vec['C1'].apply(pd.to_numeric)
output_table['C2'] = df_vec['C2'].apply(pd.to_numeric)

 

Toushi68