0

I came across the following seemingly bizarre behavior (this is a test case showing the basic issue).

from sympy import *
dz = symbols('dz')
f = 1/(dz - (1.0+I))
f1.series(dz,0,1)

this gives an error like "TypeError: gmpy.mpq() expects numeric or string argument"

On the other hand if I change 1.0 to just 1:

from sympy import *
dz = symbols('dz')
f = 1/(dz - (1+I))
f1.series(dz,0,1)

it gives the correct answer. Can someone explain me why?

woody
  • 3
  • 2

1 Answers1

0

You have to use the same name. In line 3 you use f as a name and in line 4 you use f1. Both versions give the same result when I tried them.

Stefan Gruenwald
  • 2,582
  • 24
  • 30