[Numpy-discussion] Bug (?) converting list to array

Benjamin Root ben.root at ou.edu
Mon Sep 9 09:50:39 EDT 2013


The two lists are of different sizes.

Had to count twice to catch that.

Ben Root

On Mon, Sep 9, 2013 at 9:46 AM, Chad Kidder <cckidder at gmail.com> wrote:

> I'm trying to enter a 2-D array and np.array() is returning a 1-D array of
> lists.  I'm using Python (x,y) on Windows 7 with numpy 1.7.1.  Here's the
> code that is giving me issues.
>
> >>> f1 = [[15.207, 15.266, 15.181, 15.189, 15.215, 15.198], [-45, -57,
> -62, -70, -72, -73.5, -77]]
> >>> f1a = np.array(f1)
> >>> f1a
> array([[15.207, 15.266, 15.181, 15.189, 15.215, 15.198],
>        [-45, -57, -62, -70, -72, -73.5, -77]], dtype=object)
>
> What am I missing?
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130909/4339b816/attachment.html>


More information about the NumPy-Discussion mailing list