Hi there,
I have a python code like below
if row['Inspection Date'] == None:
list_row.append(None)
list_row.append(None)
list_row.append(None)
else:
list_row.append(row['Inspection Date'][0:4])
list_row.append(row['Inspection Date'][5:7])
x = int(row['Inspection Date'][5:7])-1
list_row.append(month_names[x])
Getting this error
Traceback (most recent call last):
File "C:\Python Scripts\Production\Python Scripts\HSE - MyOsh Inspection Month Form Name.py", line 189, in <module>
x = int(row['Inspection Date'][5:7])-1
ValueError: invalid literal for int() with base 10: ''
Because the data got blank values
How can I handle blank in the mentioned code.