コード例 #1
0
ファイル: test_replace.py プロジェクト: timcera/tstoolbox
 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)
コード例 #2
0
ファイル: test_replace.py プロジェクト: timcera/tstoolbox
 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)
コード例 #3
0
ファイル: test_replace.py プロジェクト: timcera/tstoolbox
 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)
コード例 #4
0
ファイル: test_replace.py プロジェクト: timcera/tstoolbox
 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)
コード例 #5
0
ファイル: test_replace.py プロジェクト: timcera/tstoolbox
 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)
コード例 #6
0
ファイル: test_replace.py プロジェクト: timcera/tstoolbox
 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)
コード例 #7
0
 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)
コード例 #8
0
 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)
コード例 #9
0
 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)
コード例 #10
0
 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)
コード例 #11
0
 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)
コード例 #12
0
 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)