соединитель sqlite3 в python

Это не работает: я не получаю никакого элемента.

K0-float numpy, dk-int:

(k0, dk)
(<class 'numpy.float64'>, <class 'int'>)
(20.083143869749225, 6)

get_close_rods = "select xmid, ymid, angle from datos where  experiment_id=? "
get_close_rods+= "and file_id=? and ymid between ? and ? and xmid between ? and ? and angle between ? and ? "
get_close_rods+= "and major/minor between ? and ? order by ((xmid-?)*(xmid-?)+(ymid-?)*(ymid-?))*angle" 
#get_close_rods+= "order by ((xmid-?)*(xmid-?)+(ymid-?)*(ymid-?))*angle"

args = (str(experiment_id_), str(file_ids[index+1]), str(pos0[1]-dd),
            str(pos0[1]+dd), str(pos0[0]-dd), str(pos0[0]+dd),
            str(angle-dangle), str(angle+dangle), str(k0-dk), str(k0+dk),
            str(pos0[0]), str(pos0[0]), str(pos0[1]), str(pos0[1]))

cursor2.execute(get_close_rods, args)

str (k0-dk), str(k0+dk))

Это не работает:

get_close_rods = "select xmid, ymid, angle, from datos where  experiment_id=? "
get_close_rods+= "and file_id=? and ymid between ? and ? and xmid between ? and ? and angle between ? and ? "
get_close_rods+= "and major/minor between ? and ? order by ((xmid-?)*(xmid-?)+(ymid-?)*(ymid-?))*angle" 
#get_close_rods+= "order by ((xmid-?)*(xmid-?)+(ymid-?)*(ymid-?))*angle"

args = (str(experiment_id_), str(file_ids[index+1]), str(pos0[1]-dd),
            str(pos0[1]+dd), str(pos0[0]-dd), str(pos0[0]+dd),
            str(angle-dangle), str(angle+dangle), str(15), str(25),
            str(pos0[0]), str(pos0[0]), str(pos0[1]), str(pos0[1]))

cursor2.execute(get_close_rods, args)

str (15), str (25))

Не работает также, если я ставлю str(float(15)), str(float (25)) .

Он не показывает никакой ошибки, когда я использую этот запрос.

Но это работает:

get_close_rods = "select xmid, ymid, angle, from datos where  experiment_id=? "
get_close_rods+= "and file_id=? and ymid between ? and ? and xmid between ? and ? and angle between ? and ? "
#get_close_rods+= "and major/minor between ? and ? order by ((xmid-?)*(xmid-?)+(ymid-?)*(ymid-?))*angle" 
#get_close_rods+= "order by ((xmid-?)*(xmid-?)+(ymid-?)*(ymid-?))*angle"
get_close_rods+= "and major/minor between 15 and 25 order by ((xmid-?)*(xmid-?)+(ymid-?)*(ymid-?))*angle"

args = (str(experiment_id_), str(file_ids[index+1]), str(pos0[1]-dd),
            str(pos0[1]+dd), str(pos0[0]-dd), str(pos0[0]+dd),
            str(angle-dangle), str(angle+dangle), #str(15), str(25),
            str(pos0[0]), str(pos0[0]), str(pos0[1]), str(pos0[1]))

cursor2.execute(get_close_rods, args) 

#str (15), str (25))

1 ответ