I'm trying to create a Python label expression in ArcGIS Pro for a parcel layer where I only want to label the parcel when a street number in the Address field is present.If a street number is not present I want label with a statement to identify missing address. I am labeling the address of the parcel. The field type is string.

Presently I was able to create an expression where I have identified NULLS and spaces in the field(see below) but I'd like to do the same for numbers since I have fields where street numbers are not present but streets names are present.

def FindLabel ( [ADDR],[ACRES_GIS] ):
 If ([ADDR]) in (None, " ","","  ") :
  return "<BOL><CLR red='200'>"+'ADDR Absent'+ "</CLR></BOL>" +"\n"+"ac: "
  return "Addr.: "+[ADDR].split(" ")[0]+"\n"+"ac.: "+[ACRES_GIS]

Any suggestions on how to format such a script as the one I am describing?

Current Label Result

Field Format

  • Where does the street number appear in your address string? Do other numbers appear in that string, eg street names (3rd avenue) or ZIP codes? – Midavalo Jul 18 at 1:31
  • The street number is at the beginning of the string. It is possible that other numbers could exist farther back in the string. I would only want to display a label where a street number(first value) is present. – GISMapper Jul 18 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.