Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I have been able to successfully call other numpy methods such as mean, median, var and std that take only one parameter by using this type of expression:
ScriptPandas.ScriptAggr('qResult = q.std()',Value)
However, the percentile method requires at least 2 parameters https://numpy.org/doc/stable/reference/generated/numpy.percentile.html
numpy.percentile(a, q, axis=None, out=None, overwrite_input=False, interpolation='linear', keepdims=False)
Ok, I finally found it:-
SSEPython.ScriptAggrEx('D', 'numpy.percentile(args[0][0],85)',Value)
Where the parameter args[0][0] is the field and 85 is the 85th percentile.
In case anyone has a similar question, I satisfied the requirement by taking a different approach: by using the pandas quantile method together with the following expression in order to return the 25th quantile:-
ScriptPandas.ScriptAggr('qResult = q.quantile(0.25)',Value)
Ok, I finally found it:-
SSEPython.ScriptAggrEx('D', 'numpy.percentile(args[0][0],85)',Value)
Where the parameter args[0][0] is the field and 85 is the 85th percentile.