Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将浮点数组插入sqlite2表?_Sql_Sqlite - Fatal编程技术网

如何将浮点数组插入sqlite2表?

如何将浮点数组插入sqlite2表?,sql,sqlite,Sql,Sqlite,我的插入语句如下: for index, node in enumerate(nodes): id = node['ID'] embedding = node['embedding'] db_conn.execute('''INSERT INTO embedding(id, bert) VALUES(?, ?);''', (id, embedding)) “嵌入”是长度为256的浮点向量/数组。我需要将其作为表的一列插入。当前代码不起作用 如何应对?这是用Python编

我的插入语句如下:

for index, node in enumerate(nodes):
    id = node['ID']
    embedding = node['embedding']
    db_conn.execute('''INSERT INTO embedding(id, bert) VALUES(?, ?);''', (id, embedding))
“嵌入”是长度为256的浮点向量/数组。我需要将其作为表的一列插入。当前代码不起作用


如何应对?这是用Python编写的。

Sqlite2?确定吗?sqlite3,@Shawn