Notebook
# START QUERYING
s=select([prof.c.OBS_YEAR, prof.c.OBS_MONTH, prof.c.DEPTH_PRESS, prof.c.PSAL, prof.c.SSAL, prof.c.NTRA, func.case( [(prof.c.SSAL == 'NaN', prof.c.PSAL), (prof.c.SSAL != 'NaN', prof.c.SSAL) ]) ]).where( and_( prof.c.LATITUDE > 48.3, prof.c.LATITUDE < 48.8, prof.c.LONGITUDE < 125.2, prof.c.LONGITUDE > 124.3, prof.c.NTRA != 'NaN', prof.c.PSAL !='NaN', ) ) conn.execute(s).fetchall()