<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def DKL(arrays):
 """ Compute the Kullback-Leibler divergence from one distribution Q to another P, where Q and P are represented by a set of samples. Parameters arrays: tuple(1D numpy.array,1D numpy.array) samples defining distributions P & Q respectively Returns ------- float: Kullback Leibler divergence. """

    samples, prior_samples = arrays
    samples = samples[~numpy.isnan(samples)]
    prior_samples = prior_samples[~numpy.isnan(prior_samples)]
    return (
            gaussian_kde(samples).logpdf(samples)
            - gaussian_kde(prior_samples).logpdf(samples)
            ).mean()