Python Forum
How can I put an np.arange in equation's solution?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I put an np.arange in equation's solution?
#1
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))
Reply
#2
I'm pretty sure it's the spacing. Press tab on the beginning of line 7 to space it correctly
Reply
#3
Even I put the tab, the problem remains.
Reply
#4
What exactly is this supposed to do
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  output shape problem with np.arange alan6690 5 673 Dec-26-2023, 05:44 PM
Last Post: deanhystad
  Python gives " -0.0 " as solution for an equation akar 2 1,775 Aug-27-2020, 12:15 PM
Last Post: akar

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020