def _prepare_data(data, transformed, klass,  *args, **kwargs):
    """Transform data for binning.

    Returns
    -------
    np.ndarray
    """
    # TODO: Maybe include in the class itself?
    data = np.asarray(data)
    if not transformed:
        data = klass.transform(data)
    dropna = kwargs.get("dropna", False)
    if dropna:
        data = data[~np.isnan(data).any(axis=1)]
    return data
Transform data for binning.

    Returns
    -------
    np.ndarray