Trying to return everything except the last element in a field after splitting it. Using ArcMap 10.2.2 in the field calculator.
!ST_NAME!.split(" ")[:-1]
This returns a null value in attribute table. If a I use the same approach in python interactive window it seems to work:
a = "Johnny be good"
>>> b = a.split(" ")[0:-1]
>>> b
['Johnny', 'be']
f = "101 first street"; f[:f.rfind(" ")]