3

Anyone knows is there any other adapter between numpy array and sqlite database besides the atpy?

Thanks!

Rgs,

KC

1 Answer 1

3

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.]])
Sign up to request clarification or add additional context in comments.

1 Comment

i know this is kinda old now but a quick question, isnt this gonna double create items in memory like discard the python array and add a new numpy array, isnt there any way to oneshot this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.