code: def binomial(n):
      
      if n == 1:
          return [1, 1]
      elif n == 2:
          return [1, 2, 1]
      elif n == 3:
          return [1, 3, 3, 1]
      elif n == 4:
          return [1, 4, 6, 4, 1]
      elif n == 5:
          return [1, 5, 10, 10, 5, 1]
      else:
          from scipy.special import binom
          return binom(n, np.arange(n + 1))
docs: Return all binomial coefficients for a given order.
  
      For n > 5, scipy.special.binom is used, below we hardcode
      to avoid the scipy.special dependency.
  
      Parameters
      --------------
      n : int
        Order
  
      Returns
      ---------------
      binom : (n + 1,) int
        Binomial coefficients of a given order