xdem.spatialstats.nd_binning

Contents

xdem.spatialstats.nd_binning#

xdem.spatialstats.nd_binning(values, list_var, list_var_names, list_var_bins=None, statistics=('count', <function nanmedian>, <function nmad>), list_ranges=None)[source]#

N-dimensional binning of values according to one or several explanatory variables with computed statistics in each bin. By default, the sample count, the median and the normalized absolute median deviation (NMAD). The count is always computed, no matter user input. Values input is a (N,) array and variable input is a L-sized list of flattened arrays of similar dimensions (N,). For more details on the format of input variables, see documentation of scipy.stats.binned_statistic_dd.

Parameters:
  • values (NDArray[floating[Any]]) – Values array of size (N,)

  • list_var (list[NDArray[floating[Any]]]) – List of size (L) of explanatory variables array of size (N,)

  • list_var_names (list[str]) – List of size (L) of names of the explanatory variables

  • list_var_bins (int | tuple[int, ...] | tuple[NDArray[floating[Any]], ...] | None) – Count of size (1), or list of size (L) of counts or custom bin edges for the explanatory variables; defaults to 10 bins

  • statistics (Iterable[str | Callable[[NDArray[floating[Any]]], floating[Any]]]) – List of size (X) of statistics to be computed; defaults to count, median and nmad

  • list_ranges (list[float] | None) – List of size (L) of minimum and maximum ranges to bin the explanatory variables; defaults to min/max of the data

Return type:

DataFrame

Returns: