Filtering data from an exisiting table using psycopg2+sqlalchemy
You should avoid doing [0] after your query. Instead, add a .limit(1) at the end of your select.
SQA supports named column references on individual result tuples. So in addition to supporting [5], which is (as you've identified) a bad idea - it should just support .time assuming that's what your column name is. However, even better is - rather than selecting the entire table_data - simply select only the column you want.