diff python/tests/utils.txt @ 455:abe0b2347d4c

added most common utility function
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 18 Feb 2014 14:52:49 -0500
parents a7af3519687e
children bce1fe45d1b2
line wrap: on
line diff
--- a/python/tests/utils.txt	Thu Feb 13 16:42:32 2014 -0500
+++ b/python/tests/utils.txt	Tue Feb 18 14:52:49 2014 -0500
@@ -44,6 +44,15 @@
 >>> stepPlot([3, 5, 7, 8], 1, 10, 0)
 ([1, 3, 3, 5, 5, 7, 7, 8, 8, 10], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4])
 
+>>> mostCommon(['a','b','c','b'])
+'b'
+>>> mostCommon(['a','b','c','b', 'c'])
+'b'
+>>> mostCommon(range(10)+[1])
+1
+>>> mostCommon([range(2), range(4), range(2)])
+[0, 1]
+
 >>> lcss = LCSS(lambda x,y: abs(x-y) <= 0.1)
 >>> lcss.compute(range(5), range(5))
 5