English 中文(简体)
灰色-最可靠的大型矩阵数据结构
原标题:Python - Best data structure for incredibly large matrix

I need to create about 2 million vectors w/ 1000 slots in each (each slot merely contains an integer).

采用这一数据的最佳数据结构是什么? 这可能是,我低估了所涉处理/主题的数量。

我需要反复收集档案(总共约34.5GB),每当200万件物品(与病媒相对应的每件)中一带遇到时,更新病媒。

我可以轻而易举地为此撰写法典,但我知道,处理数据量的最佳时机是,为什么我向各位专家提出要求。

Best, Georgina

最佳回答

你可能记得你的机器。 不清理运行方案:

a = numpy.zeros((1000000,1000),dtype=int)

would。 但是,一般来说,如果你能够打破问题,这样你就不需要一整块记忆,或者你可以使用一种稀有的代表性,那么我会使用<条码>numpy(scipy,用于代表人数稀少)。

另外,您可考虑将数据储存在<代码>hdf5上,并登录<编码>h5py或>pytablesnetcdf4上,并可在软盘上查阅所需的部分。

问题回答

假设大部分条目为零,则使用零散矩阵。

如果在援助团工作时需要scipy.sparsemap变量。 它包括高效操纵混凝土算法。





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签