[Numpy-discussion] string matrices

Ryan Krauss ryanlists at gmail.com
Mon Apr 3 17:50:03 EDT 2006


I am trying to use NumPy to generate some matrix inputs to Maxima for
symbolic analysis.  I am using a fair number of
matrix.astype('S%d'%maxlen) statements.  This seems to work very well.
 It also doesn't seem to pad the elements in anyway if maxlen is
bigger than I need, which is great.  This may seem like a dumb
computer science question, but what is the memory/performance cost of
making maxlen bigger than I want (but making sure that it is way
bigger than I need so that the elements don't get truncated)?  If my
biggest matrices will be 13x13, how long can the strings be before I
consume more than a few megs (or a few dozen megs) of memory?

Thanks,

Ryan




More information about the NumPy-Discussion mailing list