title: SymPy ComplexInfinity
body: <p>I have defined a piecewise function using sympy and took the integral using that piecewise function. After that the integral gives the following piecewise function</p>
  <blockquote>
  <p>Piecewise((zoo*x, x &lt;= 0), (log(x) + oo, True))</p>
  </blockquote>
  <p>As I want to implement this function to sympy.lambdify() function ıt gives the error</p>
  <blockquote>
  <p>KeyError: 'ComplexInfinity'</p>
  </blockquote>
  <p>So my main purpose is to draw the graph of the first piecewise function but couldn't solve the error.
  Also the following is my code and the full error message.</p>
  <p>The Code:</p>
  <pre><code>&gt; import sympy as sp
  &gt;
  &gt;from numpy import linspace
  &gt;
  &gt;import matplotlib.pyplot as pl
  &gt;
  &gt;
  &gt;x = sp.Symbol('x')
  &gt;
  &gt;
  &gt;def b(x):
  &gt;    p = sp.Piecewise((0, x &lt;= 0), (x, x &gt; 0))
  &gt;    return p
  &gt;
  &gt;
  &gt;load = sp.integrate(b(x)**-1,x)
  &gt;print(load)
  &gt;
  &gt;
  &gt;
  &gt;loadx = sp.lambdify(x, load, modules=[&quot;numpy&quot;])
  </code></pre>
  <p>The Error Message:</p>
  <pre><code>    runfile('C:/Users/Mkaansa/Desktop/Piecewise.py', wdir='C:/Users/Mkaansa/Desktop')
  Piecewise((zoo*x, x &lt;= 0), (log(x) + oo, True))
  Traceback (most recent call last):
  
    File &quot;C:\Users\Mkaansa\Desktop\Piecewise.py&quot;, line 28, in &lt;module&gt;
      loadx = sp.lambdify(x, load, modules=[&quot;numpy&quot;])
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\utilities\lambdify.py&quot;, line 848, in lambdify
      funcstr = funcprinter.doprint(funcname, args, expr)
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\utilities\lambdify.py&quot;, line 1091, in doprint
      funcbody.append('return ({})'.format(self._exprrepr(expr)))
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\printing\codeprinter.py&quot;, line 110, in doprint
      lines = self._print(expr).splitlines()
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\printing\printer.py&quot;, line 329, in _print
      return getattr(self, printmethod)(expr, **kwargs)
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\printing\numpy.py&quot;, line 152, in _print_Piecewise
      exprs = '[{}]'.format(','.join(self._print(arg.expr) for arg in expr.args))
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\printing\numpy.py&quot;, line 152, in &lt;genexpr&gt;
      exprs = '[{}]'.format(','.join(self._print(arg.expr) for arg in expr.args))
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\printing\printer.py&quot;, line 329, in _print
      return getattr(self, printmethod)(expr, **kwargs)
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\printing\codeprinter.py&quot;, line 490, in _print_Mul
      a_str = [self.parenthesize(x, prec) for x in a]
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\printing\codeprinter.py&quot;, line 490, in &lt;listcomp&gt;
      a_str = [self.parenthesize(x, prec) for x in a]
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\printing\str.py&quot;, line 35, in parenthesize
      return self._print(item)
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\printing\printer.py&quot;, line 329, in _print
      return getattr(self, printmethod)(expr, **kwargs)
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\printing\pycode.py&quot;, line 233, in _print_ComplexInfinity
      return self._print_NaN(expr)
  
    File &quot;C:\Users\Mkaansa\anaconda3\lib\site-packages\sympy\printing\pycode.py&quot;, line 72, in _print_known_const
      known = self.known_constants[expr.__class__.__name__]
  
  KeyError: 'ComplexInfinity'
  </code></pre>