I am trying to adjust symbology using Python for a project with multiple fields that require if-else statements. The expression is below. No errors are being thrown, but there is no output. Please help if you can.
This is what I would like it to end up looking like:
Β MW-1
B: 20,000
T: 5,000
E: 9,0000
X:40,0000
Code:
def FindLabel ( [Name],[Benzene1],[Toluene1],[Ethylbenzene1],[Xylenes1] π
Β Β Β out = ""
Β Β Β
Β Β Β out += "<UND>"+"<BOL>"+str([Name])+"</BOL>"+"</UND>"+"\n"
Β Β Β
Β Β Β if float([Benzene1]) > 20000.0:
Β Β Β Β Β Β Β #bold
Β Β Β Β Β Β Β out += "<BOL>"+"B: "+ str([Benzene1]) +"</BOL>"+"\n"
Β Β Β else:
Β Β Β Β Β Β Β #normal
Β Β Β Β Β Β Β out += "B: "+ str([Benzene1]) +"\n"
Β Β Β Β Β Β Β
Β Β Β Β Β Β Β return out
Β Β Β
Β Β Β if float([Toluene1]) > 10000.0:
Β Β Β Β Β Β Β #bold
Β Β Β Β Β Β Β out += "<BOL>"+"T: "+ str([Toluene1]) +"</BOL>"+"\n"
Β Β Β else:
Β Β Β Β Β Β Β #normal
Β Β Β Β Β Β Β out += "T: "+ str([Toluene1]) +"\n"
Β Β Β Β Β Β Β return out
Β Β Β
Β Β Β if float([Ethylbenzene1]) > 15000.0:
Β Β Β Β Β Β Β #bold
Β Β Β Β Β Β Β out += "<BOL>"+"E: "+ str([Ethylbenzene1]) +"</BOL>"+"\n"
Β Β Β else:
Β Β Β Β Β Β Β #normal
Β Β Β Β Β Β Β out += "E: "+ str([Ethylbenzene1]) +"\n"
Β Β Β Β Β Β Β return out
Β Β Β
Β Β Β if float([Xylenes1]) > 12000.0:
Β Β Β Β Β Β Β #bold
Β Β Β Β Β Β Β out += "<BOL>"+"X: "+ str([Xylenes1]) +"</BOL>"+"\n"
Β Β Β else:
Β Β Β Β Β Β Β #normal
Β Β Β Β Β Β Β out += "X: "+ str([Xylenes1]) +"\n"
Β Β Β Β Β Β Β return out