def test_cohn(self): cols = ['nuncen_above', 'nobs_below', 'ncen_equal', 'prob_exceedance'] cohn = ros.cohn_numbers(self.df, self.rescol, self.cencol) pdtest.assert_frame_equal( cohn[cols], self.expected_cohn[cols], check_less_precise=True, )
def test_cohn(self): cols = ['nuncen_above', 'nobs_below', 'ncen_equal', 'prob_exceedance'] cohn = ros.cohn_numbers(self.df, self.rescol, self.cencol) # Use round in place of the deprecated check_less_precise arg assert_frame_equal( np.round(cohn[cols], 3), np.round(self.expected_cohn[cols], 3), )
def test_cohn(self): cols = [ 'nuncen_above', 'nobs_below', 'ncen_equal', 'prob_exceedance' ] cohn = ros.cohn_numbers(self.df, self.rescol, self.cencol) pdtest.assert_frame_equal( cohn[cols], self.expected_cohn[cols], check_less_precise=True, )
def test_no_NDs(self): _df = self.df.copy() _df['qual'] = False result = ros.cohn_numbers(_df, observations='conc', censorship='qual') assert result.shape == (0, 6)
def test_baseline(self): result = ros.cohn_numbers(self.df, observations='conc', censorship='censored') pdtest.assert_frame_equal(result, self.expected_baseline)
def test_no_NDs(self): _df = self.df.copy() _df['qual'] = False result = ros.cohn_numbers(_df, observations='conc', censorship='qual') ntools.assert_tuple_equal(result.shape, (0, 6))
def test_no_NDs(self): result = ros.cohn_numbers(self.df.assign(qual=False), result='conc', censorship='qual') ntools.assert_tuple_equal(result.shape, (0, 6))