开发者

numpy array <=> python DB-API adapter?

Anyone knows is there any other adapter between numpy array and sqlite database bes开发者_如何学Goides the atpy?

Thanks!

Rgs,

KC


Can you 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.]])
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜