示例#1
0
 def test_pad_nan(self):
     x = TimeSeries([np.nan, 1., np.nan, 3., np.nan],
                    ['z', 'a', 'b', 'c', 'd'], dtype=float)
     x = x.fillna(method='pad')
     expected = TimeSeries([np.nan, 1.0, 1.0, 3.0, 3.0],
                             ['z', 'a', 'b', 'c', 'd'], dtype=float)
     assert_series_equal(x[1:], expected[1:])
     self.assert_(np.isnan(x[0]), np.isnan(expected[0]))