NumPy arrays with SQLite

后端 未结 4 612
孤城傲影
孤城傲影 2021-02-04 19:39

The most common SQLite interface I\'ve seen in Python is sqlite3, but is there anything that works well with NumPy arrays or recarrays? By that I mean one that reco

4条回答
  •  迷失自我
    2021-02-04 20:11

    I found at least three Python packages to interface SQLite and NumPy:

    • esutil.sqlite_util, which is part of esutil
    • hydroclimpy.io.sqlite
    • my own RecSQL (available from github.com/orbeckst/RecSQL)

    Each of these packages has to deal with the problem that SQLite (by default) only understands standard Python types and not the NumPy data types such as numpy.int64.

    RecSQL 0.7.8+ works for me (most of the time) but I consider it a pretty bad hack and glancing over the code, esutil.sqlite_util appears to be more mature.

提交回复
热议问题