[Numpy-discussion] empty data matrix (are they really empty ?)

Sven Schreiber svetosch at gmx.net
Thu Dec 14 08:19:42 CST 2006

[you probably should have started a new thread instead of replying to
another one...]

Giorgio Luciano schrieb:

> In the old file I created a matrix  on the fly. I know that Numpy  and 
> python cannot do that so I found a workaround

I'm not sure what you mean what numpy cannot do, but...

> here's the code
> lev2=empty((1,h))


> lev=lev2[1:,]

> So
> First I create the empty matrix
> Secon perform the calculation
> Third take the matrix and exclude the first line since it has "dummy" 
> everything works fine.. but is this really necessary ? could not an empy 
> just just be "really empty" ?
> Thanks for the answers

you can use lev2 = empty((0,h)) as a starting point for adding rows, it
works and then nothing "dummy"-like will be in lev2


More information about the Numpy-discussion mailing list