I am importing values from a SQLite database and wanting to run a lambda expression over one of the columns to create a list.
cur.execute('SELECT p, T FROM W')
data = cur.fetchall()
lst = list()
for row in data:
p = float(row[0])
T = float(row[1])
lst.append(lambda T: p if T < 1 else 0)
When I run this the output is a list of the following:
< function <lambda> at 0x00000255E52AA8C8> .
I am wanting to append the list with the value of p when T < 1 and 0 if T > 1.