Generating an error in what should be a basic field calculation.
I have two text fields: MyAddress and AreaName. Both are text. I would like to use MyAddress to populate AreaName with everything except the street type. E.g. "Eagle View Ln" just becomes "Eagle View".
The code that I thought would work:
!MyAddress!.split(" ")[:-1]
I've tried it using the code block, same result.
This generates error 001156. The help documentation suggests it may be a disagreement between field type or length. I have double checked both, and been trying with a few different fields. It seems to be something with the indexing, as str() generates a string version of he appropriate list.
str(!MyAddress!.split(" ")[:-1])
returns ["Eagle", "View"] in the field.
But basic indexing seems to work on the field:
!MyAddress![:-1]
Returns Eagle View L
What am I missing here?