Я пытаюсь сделать график 'matplotlib' из следующего уравнения: q (x) = (x ** 2) / (x + 1)
Я пробовал этот код:
def r(x):
return (x*x) / (x+1)
while x<= -2 | x >= 0:
pylab.plot(x, r(x), color = 'r--')
Что показывает мне ошибку:
TypeError Traceback (most recent call last)
<ipython-input-14-387fb2375bb1> in <module>
2 return (x*x) / (x+1)
3
----> 4 while x<= -2 | x >= 0:
5 pylab.plot(x, r(x), color = 'r--')
TypeError: ufunc 'bitwise_or' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Я новичок в машинном обучении с python, поэтому у меня очень мало знаний о том, как это отладить.
Спасибо за вашу помощь!