def _get_2D_shape(df, x_key, y_key) -> tuple:
    """Infer the shape of the original 2D slice.

    Args:
        df: DataFrame.
        x_key (str): Key for the x_direction in dataframe.
        y_key (str): Key for the y_direction in dataframe

    Returns:
        x_shape, y_shape (tuple)"""
    return df[x_key].nunique(), df[y_key].nunique()