def construct_kde(samples_array, use_kombine=False):
    """Constructs a KDE from the given samples.
    """
    if use_kombine:
        try:
            import kombine
        except ImportError:
            raise ImportError("kombine is not installed.")
    # construct the kde
    if use_kombine:
        kde = kombine.clustered_kde.KDE(samples_array)
    else:
        kde = scipy.stats.gaussian_kde(samples_array.T)
    return kde
def construct_kde ( samples_array , use_kombine = False ) : if use_kombine : try : import kombine except ImportError : raise ImportError ( "kombine is not installed." ) if use_kombine : kde = kombine . clustered_kde . KDE ( samples_array ) else : kde = scipy . stats . gaussian_kde ( samples_array . T ) return kde
Constructs a KDE from the given samples.