コード例 #1
0
    def test_test_once_when_given_numpy_ndarray(self):
        data = np.array(self.data2)
        grubbs_test = grubbs.TwoSidedGrubbsTest(data)

        expected_index = 0
        actual_index = grubbs_test._test_once(data, 0.05)
        self.assertEqual(actual_index, expected_index)
コード例 #2
0
    def test_delete_item_when_given_pandas_series(self):
        if pd is not None:
            data = pd.Series(self.data3)
            grubbs_test = grubbs.TwoSidedGrubbsTest(data)

            actual_data = grubbs_test._delete_item(data, 1)
            self.assertEqual(len(actual_data), 3)
コード例 #3
0
    def test_get_target_index_when_given_numpy_ndarray(self):
        data = np.array(self.data1)
        grubbs_test = grubbs.TwoSidedGrubbsTest(data)

        expected_index = 0
        actual_index, _ = grubbs_test._target(data)
        self.assertEqual(actual_index, expected_index)
コード例 #4
0
    def test_check_type_when_given_pandas_series(self):
        if pd is not None:
            data = pd.Series(self.data1)
            grubbs_test = grubbs.TwoSidedGrubbsTest(data)
            copied_data = grubbs_test._copy_data()

            self.assertIsInstance(copied_data, pd.Series)
コード例 #5
0
    def test_test_once_when_given_pandas_series(self):
        if pd is not None:
            data = pd.Series(self.data2)
            grubbs_test = grubbs.TwoSidedGrubbsTest(data)

            expected_index = 0
            actual_index = grubbs_test._test_once(data, 0.05)
            self.assertEqual(actual_index, expected_index)
コード例 #6
0
    def test_get_target_index_when_given_pandas_series(self):
        if pd is not None:
            data = pd.Series(self.data1)
            grubbs_test = grubbs.TwoSidedGrubbsTest(data)

            expected_index = 0
            actual_index, _ = grubbs_test._target(data)
            self.assertEqual(actual_index, expected_index)
コード例 #7
0
    def test_delete_item_when_given_numpy_ndarray(self):
        data = np.array(self.data3)
        grubbs_test = grubbs.TwoSidedGrubbsTest(data)

        actual_data = grubbs_test._delete_item(data, 1)
        self.assertEqual(len(actual_data), 3)
コード例 #8
0
    def test_check_type_when_given_list(self):
        grubbs_test = grubbs.TwoSidedGrubbsTest(self.data1)
        copied_data = grubbs_test._copy_data()

        self.assertIsInstance(copied_data, np.ndarray)