changeset 128:63bf582841a3

add median
author Jeff Hammel <k0scist@gmail.com>
date Mon, 16 Mar 2015 20:59:08 -0700
parents c9ae21955ca5
children 79d99216ba17
files numerics/median.py setup.py
diffstat 2 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/numerics/median.py	Mon Mar 16 20:59:08 2015 -0700
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""
+compute median of data
+"""
+
+# imports
+import sys
+from .filters import median
+from .reduce import ReduceParser
+
+
+__all__ = ['main']
+
+
+def main(args=sys.argv[1:]):
+    """CLI"""
+    ReduceParser(median)(*args)
+
+
+if __name__ == '__main__':
+    main()
+
+
--- a/setup.py	Mon Mar 16 20:00:43 2015 -0700
+++ b/setup.py	Mon Mar 16 20:59:08 2015 -0700
@@ -27,6 +27,7 @@
     interpolate = numerics.interpolation:main
     manipulate = numerics.manipulate:main
     mean = numerics.mean:main
+    median = numerics.median:main
     plot = numerics.plot:main
     read-csv = numerics.read:main
     smooth = numerics.smooth:main