I have a CSV file which first line is the header.
Header1 | Header2 | ... | HeaderN
Cell11 | Cell12 | ... | Cell1N
. . . .
. . . .
. . . .
CellM1 | CellM2 | ... | CellMN
I would like to load the items into the local memory. Therefore I load the item as a list of dict, using the command dict(zip(self.header, item)). Then the item would look like this:
[[{Header1: Cell11}, {Header2: Cell12}... {HeaderN: Cell1N}],
[{Header1: Cell21}, {Header2: Cell22}... {HeaderN: Cell2N}],
...
[{HeaderM: CellM1}, {Header2: CellM2}... {HeaderN: CellMN}]]
the headers are the keys and the key values are in the cell.
Since the searching efficiency is low therefore I would like to find another way to store it on ram. That way would lead me to find the items effectively.
Is it better to load the CSV file into built-in sqlite3?
Thanks in advance