I have around 50,000 2D arrays and was wondering what would be the best/fastest way to store them to be accessed by a python application. The idea for the end result would be that the python program would search for a certain matrix based from the users input and then some action would be preformed on the selected array within the application. I've looked into sql database but not sure if this is the best method. It would be greatly appreciated if someone could point me in the right direction
-
There's no shortage of database engines - relationals and non-relationals (key-values, documents, graphs, whatever). You will first have to define "best" to get any valuable answer and make an informed decision.bruno desthuilliers– bruno desthuilliers2017-09-20 12:02:16 +00:00Commented Sep 20, 2017 at 12:02
Add a comment
|
1 Answer
I would suggest Numpy with CSV (http://www.numpy.org/) and only use a database if you see that numpy is not enough for your need.
3 Comments
Rodrigo Prodohl
Thanks for the reply. How would I go about calling each individual array though? Like would the best method be add all the arrays in one csv or multiple?
Rory Daulton
@RodrigoProdohl: What do you mean by "calling each individual array"? An array is not a callable object, though as an object it has callable methods. Do you mean "access each individual array" or "act upon each individual array"? Do you want all the arrays in memory at the same time or do you want to just load one at a time?
Rodrigo Prodohl
@RoryDaulton sorry I should have been more specific. I just want to load one array at a time. The user would effectively select a grid point and the array (matrix) for that specific grid point would be loaded