Error upon executing Python script (Rows can only be sliced by slice objects but got <class 'type'>)

Hi Community,

I am trying to run a Python code to fill blanks, separate cells etc on Python Script(lab) node. However, it is returning error with following message at the end.

TypeError: Rows can only be sliced by slice objects but got <class ‘type’>

I am a Python beginner, but after some Googling I am interpreting this message as “the data contains columns with data format “type” and that’s causing issues”. This is odd as all fields are either string or integer.

Does anybody know how should I deal with this error?

Please refer to the attached excel for the input data, Python script, and error message.

input and code.xlsx

Thank you for the assistance in advance!