[Numpy-discussion] array dtype=object problem
by Christopher Fonnesbeck other posts by this author
Jan 28 2006 2:31PM messages near this date
Re: [Numpy-discussion] numpy with ACML
|
Re: [Numpy-discussion] array dtype=object problem
I am having trouble with numpy arrays that have (for some reason) an
"object" dtype. All that happens in my code is that float values are
appended to a multidimensional array, this array is transposed, and
the transposed array is sent to matplotlib. Unfortunately, the array
ends up being of type "object", which is not recognized by matplotlib:
(Pdb) y[:5]
array([575.060695363, 618.395159954, 817.767177867, 601.659726372,
978.607427424], dtype=object)
(Pdb) scatter(x,y)
*** TypeError: function not supported for these types, and can't
coerce safely to supported types
Moreover, this array, which clearly contains nothing but floats
cannot be cast to a float array:
(Pdb) array(y,float)
*** TypeError: array cannot be safely cast to required type
Can anyone shed some light on this? I am utterly confused.
Thanks,
C.
--
Christopher J. Fonnesbeck
Population Ecologist, Marine Mammal Section
Fish & Wildlife Research Institute (FWC)
St. Petersburg, FL
Adjunct Assistant Professor
Warnell School of Forest Resources
University of Georgia
Athens, GA
T: 727.235.5570
E: chris at trichech.us
Attachments:
unknown1
Thread:
Christopher Fonnesbeck
Travis Oliphant
|