Integer In Python/pandas Becomes Blob (binary) In Sqlite
Storing an integer in sqlite results in BLOBs (binary values) instead of INTEGER in sqlite. The problem is the INT in the 'Baujahr' column. The table is created. CREATE TABLE 'Obj
Solution 1:
For some reason Sqlite does not accept INT larger than 8 byte. Therefore it is necessary to add the following statements.
sqlite3.register_adapter(np.int64, lambda val: int(val))
sqlite3.register_adapter(np.int32, lambda val: int(val))
The docs in sqlite are at this point a little bit short. But it works perfectly.
Post a Comment for "Integer In Python/pandas Becomes Blob (binary) In Sqlite"