parameters: (Np, ndiv=1)
return_statement: return w
docstring: Return weights for an Np-point central derivative.
  
      Assumes equally-spaced function points.
  
      If weights are in the vector w, then
      derivative is w[0] * f(x-ho*dx) + ... + w[-1] * f(x+h0*dx)
  
      Parameters
      ----------
      Np : int
          Number of points for the central derivative.
      ndiv : int, optional
          Number of divisions.  Default is 1.
  
      Notes
      -----
      Can be inaccurate for large number of points.
docstring_summary: Return weights for an Np-point central derivative.
docstring_tokens: Return weights for an Np - point central derivative .
function: def central_diff_weights(Np, ndiv=1):
      """
      Return weights for an Np-point central derivative.
  
      Assumes equally-spaced function points.
  
      If weights are in the vector w, then
      derivative is w[0] * f(x-ho*dx) + ... + w[-1] * f(x+h0*dx)
  
      Parameters
      ----------
      Np : int
          Number of points for the central derivative.
      ndiv : int, optional
          Number of divisions.  Default is 1.
  
      Notes
      -----
      Can be inaccurate for large number of points.
  
      """
      if Np < ndiv + 1:
          raise ValueError("Number of points must be at least the derivative order + 1.")
      if Np % 2 == 0:
          raise ValueError("The number of points must be odd.")
      from scipy import linalg
      ho = Np >> 1
      x = arange(-ho,ho+1.0)
      x = x[:,newaxis]
      X = x**0.0
      for k in range(1,Np):
          X = hstack([X,x**k])
      w = product(arange(1,ndiv+1),axis=0)*linalg.inv(X)[ndiv]
      return w
function_tokens: def central_diff_weights ( Np , ndiv = 1 ) : if Np < ndiv + 1 : raise ValueError ( "Number of points must be at least the derivative order + 1." ) if Np % 2 == 0 : raise ValueError ( "The number of points must be odd." ) from scipy import linalg ho = Np >> 1 x = arange ( - ho , ho + 1.0 ) x = x [ : , newaxis ] X = x ** 0.0 for k in range ( 1 , Np ) : X = hstack ( [ X , x ** k ] ) w = product ( arange ( 1 , ndiv + 1 ) , axis = 0 ) * linalg . inv ( X ) [ ndiv ] return w