code: def nancumsum(a, axis=None, dtype=None):
      """
      Return the cumulative sum of array elements over a given axis treating Not
      a Numbers (NaNs) as zero.  The cumulative sum does not change when NaNs are
      encountered and leading NaNs are replaced by zeros.
  
      Handles a subset of the edge cases handled by the nancumsum added in numpy
      1.12.0.
  
      Parameters
      ----------
      a : np.ndarray or pd.Series
  
          Input array.
  
      axis : int, optional
  
          Axis along which the cumulative sum is computed. The default
          (None) is to compute the cumsum over the flattened array.
  
      dtype : np.dtype, optional
  
          Type of the returned array and of the accumulator in which the
          elements are summed.  If `dtype` is not specified, it defaults
          to the dtype of `a`, unless `a` has an integer dtype with a
          precision less than that of the default platform integer.  In
          that case, the default platform integer is used.
  
      Returns
      -------
      nancumsum : np.ndarray or pd.Series
  
          A new array that has the same size as a, and the same shape as a.
  
      See Also
      --------
      numpy.cumsum : Cumulative sum across array propagating NaNs.
  
      """
      y = np.array(a, subok=True)
      mask = np.isnan(a)
      np.putmask(y, mask, 0.0)
      result = np.cumsum(y, axis=axis, dtype=dtype)
      np.putmask(result, mask, np.nan)
      return result
  
imports: from __future__ import division
  from functools import wraps
  import pandas
  import numpy
  from scipy import stats
  from six import iteritems
  from empyrical.utils import nanmean, nanstd, nanmin
label_desc: Use image node_id 6 for calling a global function with example usage: nancumsum(a, axis, dtype) and returns: result