def test_replace_con(self): """Test replace with con API.""" out = tstoolbox.replace([2.42, 3, 9], [1, 1, 1], input_ts=self.con_compare, ) assert_frame_equal(out, self.ats, check_dtype=False)
def test_replace_max(self): """Test replace with max API.""" out = tstoolbox.replace([3, 9], [1, 1], input_ts=self.max_compare, ) assert_frame_equal(out, self.ats, check_dtype=False)
def test_replace_nearest(self): """Test nearest replace API.""" out = tstoolbox.replace([3.0, 9.0], [1, 1], input_ts=self.nearest_compare ) assert_frame_equal(out, self.ats, check_dtype=False)
def test_replace_linear(self): """Test linear interpolation replace API.""" out = tstoolbox.replace([3.0, 4.5, 6.0, 7.5, 9.0], [1, 1, 1, 1, 1], input_ts=self.linear_compare ) assert_frame_equal(out, self.ats, check_dtype=False)
def test_replace_breplace(self): """Test backward replace API.""" out = tstoolbox.replace([3, 9], [1, 1], input_ts=self.breplace_compare ) assert_frame_equal(out, self.ats, check_dtype=False)
def test_replace_median(self): """Test replace with median API.""" out = tstoolbox.replace([2, 3, 9], [1, 1, 1], input_ts=self.median_compare, ) self.maxDiff = None assert_frame_equal(out, self.ats, check_dtype=False)
def test_replace_con(self): """Test replace with con API.""" out = tstoolbox.replace([2.42, 3, 9], [1, 1, 1], input_ts=self.con_compare) assert_frame_equal(out, self.ats, check_dtype=False)
def test_replace_max(self): """Test replace with max API.""" out = tstoolbox.replace([3, 9], [1, 1], input_ts=self.max_compare) assert_frame_equal(out, self.ats, check_dtype=False)
def test_replace_median(self): """Test replace with median API.""" out = tstoolbox.replace([2, 3, 9], [1, 1, 1], input_ts=self.median_compare) self.maxDiff = None assert_frame_equal(out, self.ats, check_dtype=False)
def test_replace_nearest(self): """Test nearest replace API.""" out = tstoolbox.replace([3.0, 9.0], [1, 1], input_ts=self.nearest_compare) assert_frame_equal(out, self.ats, check_dtype=False)
def test_replace_linear(self): """Test linear interpolation replace API.""" out = tstoolbox.replace([3.0, 4.5, 6.0, 7.5, 9.0], [1, 1, 1, 1, 1], input_ts=self.linear_compare) assert_frame_equal(out, self.ats, check_dtype=False)
def test_replace_breplace(self): """Test backward replace API.""" out = tstoolbox.replace([3, 9], [1, 1], input_ts=self.breplace_compare) assert_frame_equal(out, self.ats, check_dtype=False)