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_distance_mean(self): seq1 = [1, 2, 3, 5, 4, 0] seq2 = [1, 4, 2, 3, 5, 0] self.assertEqual(utils.reversals_distance_mean(seq1), 4.5) self.assertEqual(utils.reversals_distance_mean(seq2), 3.25)