0 values in double cells

Hello,

I am working with some sensor data, however sometimes in certain point it gives me 0 value, which is wrong! It would be ok if i would want to delete this row, but i do need it, as for example in a table with 200 columns, 1 cell has value equal to 0.

At the moment i do change double to string, than use the string replacer node, and then again string to number and missing value node (from which i can use the mean or minimum value of column etc)

Does someone know more elegant way of overcoming this issue?

 

Cheers

If I understand correctly, you want to change zeroes in a particular column to missing values.

I would typically use a Java Snippet node to test the value in the column and if zero, change to null (i.e. missing), but I fully understand many folks aren't Java programmers.

Another simple way is to use a Math Formula node (you must download the KNIME Math Expression (JEP) extension). In the Math Formula configuration dialog enter the expression:
 if($myDoubleColumn$ == 0, 0/0, $myDoubleColumn$)
Where you replace the myDoubleColumn with your column name.
This says: if the value in the myDoubleColumn is 0, replace it with 0/0 (which results in a missing value), otherwise keep the same value. This may not be the most elegant way to achieve your purpose (nor the most explicit as it relies on the 'trick' of 0/0 resulting in missing values), but it is simple.

Hope this helps,
Don

Hey Don!

 

Thanks for Your help! it is more elegant way than mine, thats for sure!