Hello, I have to stop calculation when my data variable reach a certain size ( weight). How can i know the weight in (Kb or Mb) of an object - either a list of matrix or a matrix itself ? Best Regards Robert --------------------------------- Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
On 6/6/07, Robert VERGNES <robert.vergnes@yahoo.fr> wrote:
Hello, I have to stop calculation when my data variable reach a certain size ( weight). How can i know the weight in (Kb or Mb) of an object - either a list of matrix or a matrix itself ?
Best Regards
Robert
Are you asking for the number of bytes of memory allocated for a numpy array? In [1]: import numpy In [2]: a = numpy.ones((2,2)) In [3]: a.nbytes Out[3]: 32
yes. it helps. Just the problem is that I have a list with some numarray inside, but also some string and some other things. ( this list is an incoming stack which I have to clean when it reahes a certain size... I thought that there would be a 'nbytes' fonction attached any to python data object ? Alexander Michael <lxander.m@gmail.com> a écrit : On 6/6/07, Robert VERGNES wrote:
Hello, I have to stop calculation when my data variable reach a certain size ( weight). How can i know the weight in (Kb or Mb) of an object - either a list of matrix or a matrix itself ?
Best Regards
Robert
Are you asking for the number of bytes of memory allocated for a numpy array? In [1]: import numpy In [2]: a = numpy.ones((2,2)) In [3]: a.nbytes Out[3]: 32 _______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user --------------------------------- Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
participants (2)
-
Alexander Michael -
Robert VERGNES