[SciPy-user] object_arrtype addition error

Chris Fonnesbeck fonnesbeck at gmail.com
Tue Nov 29 09:02:09 CST 2005

On 11/29/05, Chris Fonnesbeck <fonnesbeck at gmail.com> wrote:
> On 11/28/05, Travis Oliphant <oliphant.travis at ieee.org> wrote:
> > Chris Fonnesbeck wrote:
> >
> > >Under scipy_core, I have a dictionary that contains what I thought
> > >were floating point numbers, but are actually 'object_arrtype':
> > >
> > >
> > >
> > One question is why these are object array scalars (entries in an object
> > array), instead of floating point numbers in the first place.  Perhaps
> > there is something going on there.
> >
> Its just my PyMC code calculating the quantiles of the trace (the big
> array of sampled values), and throwing those values into a dictionary:

I figured it out. The trace array is intitialized as:

self._trace = array([None]*size)

Which, of course, is of type object_arrtype. When each element is
replaced by a proper value, the type does not change. I suppose I have
to initialize to float values, though I liked using None's under
numeric because if for some reason the whole array was not populated,
I would get an error if I tried to do anything useful with the array.

Chris Fonnesbeck
Atlanta, GA

More information about the SciPy-user mailing list