Le mercredi 20 février 2013 à 13:35 +0000, Robert Kern a écrit :
> On Wed, Feb 20, 2013 at 1:25 PM, Neal Becker <ndbeck...@gmail.com> wrote:
> > I tried to save a vector as a csv, but it didn't work.
> >
> > The vector is:
> > a[0,0]
> > array([-0.70710678-0.70710678j,  0.70710678+0.70710678j,
> >         0.70710678-0.70710678j,  0.70710678+0.70710678j,
> ...
> >  np.savetxt ('test.out', a[0,0], delimiter=',')
> >
> > The saved txt file says:
> >  (-7.071067811865540120e-01+-7.071067811865411334e-01j)
> >  (7.071067811865535679e-01+7.071067811865415775e-01j)
> >  (7.071067811865422437e-01+-7.071067811865529018e-01j)
> >  (7.071067811865520136e-01+7.071067811865431318e-01j)
> >  ...
> 
> What were you expecting? A single row? savetxt() always writes out
> len(arr) rows. Reshape your vector into a (1,N) array if you want a
> single row.

The imaginary part seems broken, see the succession "+-" for negative
imaginary parts.

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to