[Numpy-discussion] resizing arrays

Neal Becker ndbecker2@gmail....
Fri Feb 15 07:49:25 CST 2008


I have a situation where I'm going to save some data sets to plot, but I
don't know a-priori how many sets there will be.  I'm using this code:

try:
  shape = list(phase_plots.shape)
  shape[0] += 1
  phase_plots.resize (shape, refcheck=0)
except NameError:
  phase_plots = empty ((1, 2*iterations+1, l))

This works, I'm just wondering if this is a reasonable approach or if maybe
something else would be better (or more efficient).




More information about the Numpy-discussion mailing list