In [13]: array([array([1,'A', None], dtype=object),array([2,2,'Some string'],dtype=object)], dtype=object).shape
Out[13]: (2,)
and
In [14]: array([array([1,'A', None], dtype=object),array([2,2,'Some string'],dtype=object)]).shape
Out[14]: (2, 3)
On 8/31/06, Tom Denniston <tom.denniston@alum.dartmouth.org > wrote:But i have hetergenious arrays that have numbers and strings and NoneType, etc.
Take for instance:
In [11]: numpy.array([numpy.array([1,'A', None]),
numpy.array([2,2,'Some string'])], dtype=object)
Out[11]:
array([[1, A, None],
[2, 2, Some string]], dtype=object)
In [12]: numpy.array([ numpy.array([1,'A', None]),
numpy.array([2,2,'Some string'])], dtype=object).shape
Out[12]: (2, 3)
Works fine in Numeric and pre beta numpy but in beta numpy versions i get:Which makes good sense to me.
I think you want:
In [59]: a = array([array([1,'A', None],dtype=object),array([2,2,'Some string'],dtype=object)])
In [60]: a.shape
Out[60]: (2, 3)
Chuck
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion