[Scipy-svn] r4830 - trunk/scipy/stats/tests

scipy-svn@scip... scipy-svn@scip...
Sat Oct 25 04:13:09 CDT 2008


Author: cdavid
Date: 2008-10-25 04:13:05 -0500 (Sat, 25 Oct 2008)
New Revision: 4830

Modified:
   trunk/scipy/stats/tests/test_stats.py
Log:
Add old median test to new median test.

Modified: trunk/scipy/stats/tests/test_stats.py
===================================================================
--- trunk/scipy/stats/tests/test_stats.py	2008-10-25 07:36:42 UTC (rev 4829)
+++ trunk/scipy/stats/tests/test_stats.py	2008-10-25 09:13:05 UTC (rev 4830)
@@ -685,6 +685,14 @@
         assert_almost_equal(stats.median(data1),2.5)
         assert_almost_equal(stats.median(data2),5)
 
+    def test_basic2(self):
+        a1 = [3,4,5,10,-3,-5,6]
+        a2 = [3,-6,-2,8,7,4,2,1]
+        a3 = [3.,4,5,10,-3,-5,-6,7.0]
+        assert_equal(stats.median(a1),4)
+        assert_equal(stats.median(a2),2.5)
+        assert_equal(stats.median(a3),3.5)
+
 class TestMode(TestCase):
     def test_basic(self):
         data1 = [3,5,1,10,23,3,2,6,8,6,10,6]



More information about the Scipy-svn mailing list