# Path: ndd/exceptions.py
# class DataArrayError(NddError):
#     """Input is not a valid data array."""
# 
# class NddError(Exception):
#     """Base class for ndd exceptions."""


import logging
import numpy
from itertools import combinations
from numbers import Integral
from operator import itemgetter
from ndd.exceptions import DataArrayError, NddError
    from collections.abc import Sequence
    from collections import Sequence
    return x.is_integer()


class DataArray(Sequence):
    """Data container with methods for counts calculation.

    Stores data as a p-by-n numpy ndarray.

    Parameters
    ----------
    ar : array-like, shape (n, p)
        2D array of n samples from p discrete variables.
    axis : int, optional
        The sample-indexing axis. Defaults to axis=0.
    ks : array-like, shape p or int or None, optional
        The alphabet size for the p variables.
        If int: the variables share the same alphabet size.
        If None (default), the alphabet size is unkown.
    k : int or None, optional
        Alphabet size for the p-dimensional joint PMF.

    """

    def __init__(self, ar, axis=0, ks=None, k=None):
        # set data
        if not isinstance(ar, self.__class__):
            ar = numpy.atleast_2d(ar)
            if not ar.size:
                raise NddError('Empty data array')
            if ar.ndim > 2:

# Path: ndd/exceptions.py
# class DataArrayError(NddError):
#     """Input is not a valid data array."""
# 
# class NddError(Exception):
#     """Base class for ndd exceptions."""


# Path: ndd/data.py
import logging
import numpy
from itertools import combinations
from numbers import Integral
from operator import itemgetter
from ndd.exceptions import DataArrayError, NddError
    from collections.abc import Sequence
    from collections import Sequence

    return x.is_integer()


class DataArray(Sequence):
    """Data container with methods for counts calculation.

    Stores data as a p-by-n numpy ndarray.

    Parameters
    ----------
    ar : array-like, shape (n, p)
        2D array of n samples from p discrete variables.
    axis : int, optional
        The sample-indexing axis. Defaults to axis=0.
    ks : array-like, shape p or int or None, optional
        The alphabet size for the p variables.
        If int: the variables share the same alphabet size.
        If None (default), the alphabet size is unkown.
    k : int or None, optional
        Alphabet size for the p-dimensional joint PMF.

    """

    def __init__(self, ar, axis=0, ks=None, k=None):
        # set data
        if not isinstance(ar, self.__class__):
            ar = numpy.atleast_2d(ar)
            if not ar.size:
                raise NddError('Empty data array')
            if ar.ndim > 2:

                raise NddError('Input array has %s dimensions; must be 2D' %