title: Fourier series of a box function using sympy
body: <p>I tried this code but i m getting an error. And If possible pls tell me how to lambdify the defined funct
  CODE</p>
  
  <pre><code>from sympy.abc import x
  from sympy import *
  
  init_printing()
  def func(y):
      if y&gt;0:
          return 1
      elif y&lt;0:
          return -1
      else:
          return 0
  s = fourier_series(func(x), (x, -1, 1))
  s = s.truncate(n=4)
  s
  </code></pre>
  
  <p>"TypeError: cannot determine truth value of Relational"
  this is the error im getting
  Please help, 
  Thank you.</p>