Ejemplo n.º 1
0
 def schmuckler_oscillation(self):
     seq = list(self.to_tuple())
     rev_sum = utils.reversals_count(seq)
     rev_mean = utils.reversals_count(seq) / float(self.size)
     interval_sum = utils.reversals_distance_sum(seq)
     interval_mean = utils.reversals_distance_mean(seq)
     ind = ['Summed Reversals', 'Mean Reversals', 'Summed Interval', 'Mean Interval']
     return pandas.Series([rev_sum, rev_mean, interval_sum, interval_mean], index=ind)
 def test_reversals_count(self):
     seq1 = [1, 2, 3, 5, 4, 0]
     seq2 = [1, 4, 2, 3, 5, 0]
     self.assertEqual(utils.reversals_count(seq1), 1)
     self.assertEqual(utils.reversals_count(seq2), 3)
Ejemplo n.º 3
0
 def oscillation(self):
     seq = list(self.to_tuple())
     if self.size < 3:
         return 0
     return utils.reversals_count(seq) / float(self.size)