# Path: ndd/exceptions.py
# class NddError(Exception):
#     """Base class for ndd exceptions."""


import collections
import collections.abc
import numbers
import numpy
from types import GeneratorType
from ndd.exceptions import NddError
    from pandas import DataFrame, Series
    from bounter import bounter

        """
        if key is None:
            key = 'full'

        if key not in self.statistics:  # compute statistics
            if key == 'full':
                data, order = self.data, 0
            else:
                index, order = self.array_index(key)
                data = self.data[index]

            stats = self._counts(data)
            if order <= self.order:  # save statistics
                self.statistics[key] = stats
        else:
            stats = self.statistics[key]

        keys, values = stats

        if self.stat == 'multiplicities' and k is not None:
            # append statistics for non-observed bins
            if isinstance(k, collections.Mapping):
                try:
                    k = k[key]
                except KeyError:
                    if order > 1:  # use combinatorics
                        try:
                            k = numpy.prod(k[x] for x in key)
                        except KeyError:

# Path: ndd/exceptions.py
# class NddError(Exception):
#     """Base class for ndd exceptions."""


# Path: ndd/counters.py
import collections
import collections.abc
import numbers
import numpy
from types import GeneratorType
from ndd.exceptions import NddError
    from pandas import DataFrame, Series
    from bounter import bounter


        """
        if key is None:
            key = 'full'

        if key not in self.statistics:  # compute statistics
            if key == 'full':
                data, order = self.data, 0
            else:
                index, order = self.array_index(key)
                data = self.data[index]

            stats = self._counts(data)
            if order <= self.order:  # save statistics
                self.statistics[key] = stats
        else:
            stats = self.statistics[key]

        keys, values = stats

        if self.stat == 'multiplicities' and k is not None:
            # append statistics for non-observed bins
            if isinstance(k, collections.Mapping):
                try:
                    k = k[key]
                except KeyError:
                    if order > 1:  # use combinatorics
                        try:
                            k = numpy.prod(k[x] for x in key)
                        except KeyError:

                            return NddError('counts(): check k dictionary')