Python Forum

Full Version: How can I put an np.arange in equation's solution?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I fix the issue in this code? It says "can't initialize from 'list' without generators". Thank for your help!
from sympy.solvers import solve
from sympy import Symbol
from sympy import solve, Poly, Eq, Function, exp
from sympy.abc import x, y, z, a, b

def f(x,y):
return solve(Poly(x**2*y+(23+y)*x+y**2),y)

x=np.arange(-20,20,0.1)
y=2

print(f(x,y))
I'm pretty sure it's the spacing. Press tab on the beginning of line 7 to space it correctly
Even I put the tab, the problem remains.
What exactly is this supposed to do