Array numpy <=> python DB-API adapter?

Does anyone know if there is another adapter between the numpy array and the sqlite database other than atpy?

Thank!

Rgs,

KC

+3
source share
1 answer

Can I use the default package sqlite3?

In [1]: import sqlite3

In [3]: conn = sqlite3.connect('test.db')

In [4]: cur = conn.cursor()

In [5]: cur.execute('select * from table1')
Out[5]: <sqlite3.Cursor object at 0xa3142c0>

In [6]: scipy.array(cur.fetchall())
Out[6]: 
array([[ 1.,  2.],
       [ 3.,  4.]])
+3
source

Source: https://habr.com/ru/post/1765062/


All Articles