def test_column_degeneracy(self): """column_degeneracy: should work with different cutoff values """ a = array([[.1,.8,.3],[.3,.2,.3],[.6,0,.4]]) self.assertEqual(column_degeneracy(a,cutoff=.75),[2,1,3]) self.assertEqual(column_degeneracy(a,cutoff=.45),[1,1,2]) #one-dimensional array self.assertRaises(ValueError, column_degeneracy,\ array([.25,.25,.25,.25])) #if cutoff value is not found, results are clipped to the #number of rows in the array self.assertEqual(column_degeneracy(a,cutoff=2), [3,3,3]) #same behavior on empty array self.assertEqual(column_degeneracy(array([[]])),[])
def columnDegeneracy(self, cutoff=0.5): """Returns how many chars are neede to cover the cutoff value See rowDegeneracy for more information. """ try: return column_degeneracy(self.Data, cutoff) except ValueError: raise ProfileError, "Profile has to be two dimensional to calculate columnDegeneracy"
def columnDegeneracy(self, cutoff=0.5): """Returns how many chars are neede to cover the cutoff value See rowDegeneracy for more information. """ try: return column_degeneracy(self.Data,cutoff) except ValueError: raise ProfileError("Profile has to be two dimensional to calculate columnDegeneracy")