In trying to upgrade code from Python 2 to 3, the below code broke for a calculate field that functioned in 2.x. I tried putting double quotes around the (' & ') based on some searching, but did not do the trick.
!FullName!.split(' & ').split('/')
The error is:
ERROR 000539: Traceback (most recent call last):
File "<expression>", line 1, in <module>
IndexError: list index out of range
Failed to execute (Calculate Field (4)).
check your data, it means that one of the splits doesn't yield what you expect.
You want the 2nd portion from the first split and the first from the second split.
If you have an entry the doesn't contain "blah & Blah/done" with an " & "and a "/" then it will fail.
One possible problem is the extra spaces around the ampersand. "&" is very different from " & "
Here's another vote for a data issue; I won't even go into my usual tirade of special characters in free text fields. You've already discovered one of the reasons I don't like them....