The Problem is how you access row
Specifically row["waocs"]
and row["pool_number"]
of ocs[row["pool_number"]]=int(row["waocs"])
If you look up the official-documentation of fetchall()
you find.
The method fetches all (or all remaining) rows of a query result set and returns a list of tuples.
Therefore you have to access the values of rows with row[__integer__]
like row[0]