code: def ppmt(rate, per, nper, pv, fv=0, when="end"):
      """
      Compute the payment against loan principal.
  
      Parameters
      ----------
      rate : array_like
          Rate of interest (per period)
      per : array_like, int
          Amount paid against the loan changes.  The `per` is the period of
          interest.
      nper : array_like
          Number of compounding periods
      pv : array_like
          Present value
      fv : array_like, optional
          Future value
      when : {{'begin', 1}, {'end', 0}}, {string, int}
          When payments are due ('begin' (1) or 'end' (0))
  
      See Also
      --------
      pmt, pv, ipmt
  
      """
      total = pmt(rate, nper, pv, fv, when)
      return total - ipmt(rate, per, nper, pv, fv, when)
  
imports: from __future__ import division, absolute_import, print_function
  from decimal import Decimal
  import functools
  import numpy
  from numpy.core import overrides
label_desc: Use image node_id 12 for calling a global function with example usage: ppmt(rate, per, nper, pv, fv, when) and returns: unknown