Неравенство будет примерно таким, как показано ниже:
Код: Выделить всё
P < mean - 2.5*standard deviationЭто демонстрационный код:
Код: Выделить всё
from sympy.solvers import solve
from sympy import Symbol
x = Symbol('x')
solve(x-np.mean([1,2,3,x])-np.std([1,2,3,x]), x)
Код: Выделить всё
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
AttributeError: 'Add' object has no attribute 'sqrt'
The above exception was the direct cause of the following exception:
TypeError Traceback (most recent call last)
Input In [71], in ()
2 from sympy import Symbol
3 x = Symbol('x')
----> 4 solve(x-np.mean([1,2,3,x])-np.std([1,2,3,x]), x)
File ~/opt/anaconda3/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3645, in std(a, axis, dtype, out, ddof, keepdims, where)
3642 else:
3643 return std(axis=axis, dtype=dtype, out=out, ddof=ddof, **kwargs)
-> 3645 return _methods._std(a, axis=axis, dtype=dtype, out=out, ddof=ddof,
3646 **kwargs)
File ~/opt/anaconda3/lib/python3.9/site-packages/numpy/core/_methods.py:214, in _std(a, axis, dtype, out, ddof, keepdims, where)
212 ret = ret.dtype.type(um.sqrt(ret))
213 else:
--> 214 ret = um.sqrt(ret)
216 return ret
TypeError: loop of ufunc does not support argument 0 of type Add which has no callable sqrt method
Подробнее здесь: https://stackoverflow.com/questions/783 ... -in-python