CREATE OR REPLACE FUNCTION py_numeric_median(_numeric) RETURNS text AS $$ import numpy # t = eval(args[0].replace("{","[").replace("}","]")) t = args[0].replace("{","").replace("}","").split(",") t1 = [] for v in t: t1.append(float(v)) return numpy.median(t1) $$ LANGUAGE 'plpythonu';
en PL/Python
- 4825 lectures