I have a database containing a table and I want to compute the mean of a column without importing all of the rows and doing it directly in python; I think doing that would take longer (computation-wise and code-wise) than doing it using sqlite. I figured that the following should work:
cursor.execute('SELECT AVG(column) FROM table')
However, I have no idea how to actually extract the output of this SQL command. I can't find a useful method of the cursor class in the documentation (https://docs.python.org/3/library/sqlite3.html) to help me with this.
Please tell me if what I'm doing makes no sense or is stupid; I have not used SQL before so it might be either of both of the above.
Thank you