[SciPy-Dev] Unexpected behaviour from timeseries.filled (in Python 2.7)

Åsmund Hjulstad asmund.hjulstad at gmail.com
Mon Sep 6 13:37:20 EDT 2010


2010/9/6 Pierre GM <pgmdevlist at gmail.com>:
>
> On Sep 6, 2010, at 5:32 PM, Åsmund Hjulstad wrote:
>>
>> After some debugging, I found out the following:
>> the TimeSeries.filled() method does this:
>> result = self._series.filled(fill_value=fill_value).view(type(self))
>> somehow, the _series view does not retain the fill value.
>> replacing this with (around line 1217 in tseries.py)
>> result = MaskedArray.filled(self,fill_value=fill_value).view(type(self))
>> things work better (for me, at least)
>
> Åsmund,
> Glad you were able to figure it out by yourself (and showing me where th pb was).
> Nevertheless, do you mind opening a ticket ? I have quite a few to process first, and I don't want this one to fall between the cracks.
> Thanks a lot in advance.

I will, one question though: Why does MaskedArray reset the fill_value
when creating a view?  This, appearantly, is what happens when the
self._series property is accessed. Isn't it more reasonable to
preserve it? I haven't been able to pinpoint what exactly caused the
behaviour to change, whether it was the Numpy 1.3 -> 1.5 change or the
Python 2.6 -> 2.7   (I would guess the former, though.)

Ticket #105 created.   http://projects.scipy.org/scikits/ticket/105



More information about the SciPy-Dev mailing list