class_docstr: Akima interpolator
  
  Fit piecewise cubic polynomials, given vectors x and y. The interpolation
  method by Akima uses a continuously differentiable sub-spline built from
  piecewise cubic polynomials. The resultant curve passes through the given
  data points and will appear smooth and natural.
  
  Parameters
  ----------
  x : ndarray, shape (m, )
      1-D array of monotonically increasing real values.
  y : ndarray, shape (m, ...)
      N-D array of real values. The length of `y` along the first axis must
      be equal to the length of `x`.
  axis : int, optional
      Specifies the axis of `y` along which to interpolate. Interpolation
      defaults to the first axis of `y`.
  
  Methods
  -------
  __call__
  derivative
  antiderivative
  roots
  
  See Also
  --------
  PchipInterpolator
  CubicSpline
  PPoly
  
  Notes
  -----
  .. versionadded:: 0.14
  
  Use only for precise data, as the fitted curve passes through the given
  points exactly. This routine is useful for plotting a pleasingly smooth
  curve through a few given points for purposes of plotting.
  
  References
  ----------
  [1] A new method of interpolation and smooth curve fitting based
      on local procedures. Hiroshi Akima, J. ACM, October 1970, 17(4),
      589-602.
class_docstr_tok: ["Akima","interpolator","Fit","piecewise","cubic","polynomials",",","given","vectors","x","and","y",".","The","interpolation","method","by","Akima","uses","a","continuously","differentiable","sub-spline","built","from","piecewise","cubic","polynomials",".","The","resultant","curve","passes","through","the","given","data","points","and","will","appear","smooth","and","natural",".","Parameters","--","--","--","--","--","x",":","ndarray",",","shape","(","m",",",")","1-D","array","of","monotonically","increasing","real","values",".","y",":","ndarray",",","shape","(","m",",","...",")","N-D","array","of","real","values",".","The","length","of","`","y","`","along","the","first","axis","must","be","equal","to","the","length","of","`","x","`",".","axis",":","int",",","optional","Specifies","the","axis","of","`","y","`","along","which","to","interpolate",".","Interpolation","defaults","to","the","first","axis","of","`","y","`",".","Methods","--","--","--","-","__call__","derivative","antiderivative","roots","See","Also","--","--","--","--","PchipInterpolator","CubicSpline","PPoly","Notes","--","--","-","..","versionadded",":",":","0.14","Use","only","for","precise","data",",","as","the","fitted","curve","passes","through","the","given","points","exactly",".","This","routine","is","useful","for","plotting","a","pleasingly","smooth","curve","through","a","few","given","points","for","purposes","of","plotting",".","References","--","--","--","--","--","[","1","]","A","new","method","of","interpolation","and","smooth","curve","fitting","based","on","local","procedures",".","Hiroshi","Akima",",","J.","ACM",",","October","1970",",","17","(","4",")",",","589-602","."]
code: def __init__(self, x, y, axis=0):
      # Original implementation in MATLAB by N. Shamsundar (BSD licensed), see
      # https://www.mathworks.com/matlabcentral/fileexchange/1814-akima-interpolation
      x, y = map(np.asarray, (x, y))
      axis = axis % y.ndim
  
      if np.any(np.diff(x) < 0.0):
          raise ValueError("x must be strictly ascending")
      if x.ndim != 1:
          raise ValueError("x must be 1-dimensional")
      if x.size < 2:
          raise ValueError("at least 2 breakpoints are needed")
      if x.size != y.shape[axis]:
          raise ValueError("x.shape must equal y.shape[%s]" % axis)
  
      # move interpolation axis to front
      y = np.rollaxis(y, axis)
  
      # determine slopes between breakpoints
      m = np.empty((x.size + 3,) + y.shape[1:])
      dx = np.diff(x)
      dx = dx[(slice(None),) + (None,) * (y.ndim - 1)]
      m[2:-2] = np.diff(y, axis=0) / dx
  
      # add two additional points on the left ...
      m[1] = 2.0 * m[2] - m[3]
      m[0] = 2.0 * m[1] - m[2]
      # ... and on the right
      m[-2] = 2.0 * m[-3] - m[-4]
      m[-1] = 2.0 * m[-2] - m[-3]
  
      # if m1 == m2 != m3 == m4, the slope at the breakpoint is not defined.
      # This is the fill value:
      t = 0.5 * (m[3:] + m[:-3])
      # get the denominator of the slope t
      dm = np.abs(np.diff(m, axis=0))
      f1 = dm[2:]
      f2 = dm[:-2]
      f12 = f1 + f2
      # These are the mask of where the the slope at breakpoint is defined:
      ind = np.nonzero(f12 > 1e-9 * np.max(f12))
      x_ind, y_ind = ind[0], ind[1:]
      # Set the slope at breakpoint
      t[ind] = (
          f1[ind] * m[(x_ind + 1,) + y_ind]
          + f2[ind] * m[(x_ind + 2,) + y_ind]
      ) / f12[ind]
      # calculate the higher order coefficients
      c = (3.0 * m[2:-2] - 2.0 * t[:-1] - t[1:]) / dx
      d = (t[:-1] + t[1:] - 2.0 * m[2:-2]) / dx**2
  
      coeff = np.zeros((4, x.size - 1) + y.shape[1:])
      coeff[3] = y[:-1]
      coeff[2] = t[:-1]
      coeff[1] = c
      coeff[0] = d
  
      super(Akima1DInterpolator, self).__init__(
          coeff, x, extrapolate=False
      )
      self.axis = axis
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from scipy._lib.six import string_types
  from .None import BPoly, PPoly
  from .polyint import _isscalar
  from scipy._lib._util import _asarray_validated
  from scipy.linalg import solve_banded, solve
label_desc: Use image node_id 1 to create a new Akima1DInterpolator object from inherited base classes: PPoly with example: obj = Akima1DInterpolator(x, y, axis)