[SciPy-user] Zeros

Stéfan van der Walt stefan at sun.ac.za
Sat Mar 15 13:57:06 EDT 2008


Hey Natali

On Sat, Mar 15, 2008 at 10:30 AM, Natali Melgarejo Diaz
<nmelgarejodiaz at gmail.com> wrote:
> I want to make a column vector using numpy, like in Matlab when you do
> zeros(N,1). I've been doing it with zeros(N) and i already get an array. It
> maybe be the same but the results  get are different with the formulas
> involved.

You can either create the array with the extra dimension, i.e.

zeroes([N,1])

or you can use the matrix class, which always returns arrays with a
minimum of two dimensions.  I recommend the first approach.

Regards
Stéfan



More information about the SciPy-User mailing list