Handling null values

I removed the loop.

I think the pythonic way to coalesce and use int() would be:

value = int(tableanalyses_data[0]) or 'N/A' if tableanalyses_data[0] is not None else 'N/A'

That said, this test would probably be better served in the query.