How can i get rid of Null and Infinity!

Hello,

I just want to get rid of this values. so i do it, with 2 boolmasks. but i think there is a better way. Can i combine this filter rules?
there is this issue "" ; null ; Null ,

KR

Andreas


Use this in codeblock
x>100000 || x==null ? false:true

@theshysnail still i need 2 boolfilters!

You’re getting Null with a capital N? Most probably those are just string values. Try "Null" or Null instead of null.

x>100000 || x=="Null" ? false:true

1 Like

@theshysnail they are not strings… that are areavalues which are stored in a Parameter.
the infinity, Null and null comes from there

@Draxl_Andreas would that work?

1 Like

The problem is not the conditional statement. You can see that it’s returning the correct booleans. If you read the error from FilterByBoolMask it states that it’s merely a warning that the Infinity value is outside the working range. You actually just need another condition to convert the Infinity to something within range.


As an FYI, you can see that in later versions Dynamo still handles the booleans appropriately.

1 Like

@Nick_Boyts @Elie.Trad @theshysnail
I should never say to a college “it is a easy task for dynamo!” :slight_smile:

What is it that you’re trying to do? You can’t convert a null to a string so you’re still going to have issues. I thought you just wanted to filter the out the non-real numbers?

@Nick_Boyts i want to remove all from my value.list thats not a area.Value.
Null
null
infinity

                                     #here_is_nothing

Then you’ll have to do something like I suggested in my first post, which is to convert the Infinity value to a real number within your working range.

1 Like

@Draxl_Andreas use the node String from Object

Ok, i give it a try! :wink:

1 Like

I solved the problem… i can live with the warning. my calculated vales get filed correctly! @Elie.Trad

@Draxl_Andreas use String from Object instead of the Code Block x+"" as well :smiley:

1 Like

Again, you can bypass the warning by converting the Infinity to something in range.


Converting everything to a string would work as well.

1 Like

@Nick_Boyts

there is still a sorting issue?


2022-05-16_17h15_18

@Elie.Trad @Nick_Boyts @theshysnail
look at that :slight_smile:


OUT = []

for i in IN[0]:
	if i >= 99999:
		OUT.append(False)
	elif i == None :		
		OUT.append(False)
	else:
		OUT.append(True)

that works for me so Null + null = None :slight_smile:

2022-05-16_17h34_26

That’s cause you only gave it 3 booleans. I was just showing you an example with those values. You obviously have to use the appropriate booleans (based on your conditional statement) for your set of values.

1 Like

But infinity is a value… not a happy one for math purposes, but a value all the same!

I would replace the 0 with a alternative number prior to doing the math.

1 Like