I am trying to translate the below structure:
newDV = []
for row in dataVector:
for cell in row:
newDV.append((cell if row.index(cell) != 0 else 'other'))
This is the list comprehension structure:
[
cell
for cell in row
for row in dataVector
if row.index(cell) != 0 else 'other'
]
I am getting the error:
UnboundLocalError: local variable 'row' referenced before assignment