code: def prob2cdf_grid(probs):
      """Cumulative probabilities from cell provabilites on a grid
  
      Parameters
      ----------
      probs : array_like
          Rectangular grid of cell probabilities.
  
      Returns
      -------
      cdf : ndarray
          Grid of cumulative probabilities with same shape as probs.
      """
      cdf = np.asarray(probs).copy()
      k = cdf.ndim
      for i in range(k):
          cdf = cdf.cumsum(axis=i)
  
      return cdf
  
file_path: statsmodels/statsmodels/distributions/tools.py
imports: import warnings
  import numpy
  from scipy import interpolate, stats
label_desc: Use image node_id 1 for calling a global function with example usage: prob2cdf_grid(probs) and returns: cdf