Array Memory Allocation Size
Paul F. Dubois
pauldubois at home.com
Mon Jun 26 12:22:01 EDT 2000
print len(ravel(x)) * x.itemsize()
Also be sure to check out the new spacesaver features.
Konrad Hinsen <hinsen at cnrs-orleans.fr> wrote in message
news:m3bt0o4wa2.fsf at chinon.cnrs-orleans.fr...
> Curtis Jensen <cjensen at bioeng.ucsd.edu> writes:
>
> > I'm using NumPy to allocate heaps of arrays. Is there a command to find
> > out how much space each array is using in memory?
>
> By C code, yes. From Python, no, because you cannot find out
> how much space each element takes up, and that is compiler dependent.
> --
> --------------------------------------------------------------------------
-----
> Konrad Hinsen | E-Mail: hinsen at cnrs-orleans.fr
> Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69
> Rue Charles Sadron | Fax: +33-2.38.63.15.17
> 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/
> France | Nederlands/Francais
> --------------------------------------------------------------------------
-----
More information about the Python-list
mailing list