def correlation_columns(dataset: pd.DataFrame, target_column: str, k: float=0.5):
    '\n    Columns that are correlated to the target point\n\n    Parameters\n    ----------\n\n    dataset: pd.DataFrame\n        The pandas dataframe\n    \n    target_column: str\n        The target column to calculate correlation against\n\n    k: float\n        The correlation cuttoff point; defaults to -0.5 and 0.5.\n        The values passed in represents the negative and positive cutofff\n\n    Returns\n    -------\n\n    columns: list\n        A list of columns that are correlated to the target column based on the cutoff point\n    '
    corr = np.abs(dataset.corr()[target_column])
    corr_sorted = corr.sort_values(ascending=False)
    columns = [col for (col, value) in zip(corr_sorted.index, corr_sorted.values) if ((value >= k) and (col != target_column))]
    return columns
Columns that are correlated to the target point

Parameters
----------

dataset: pd.DataFrame
    The pandas dataframe

target_column: str
    The target column to calculate correlation against

k: float
    The correlation cuttoff point; defaults to -0.5 and 0.5.
    The values passed in represents the negative and positive cutofff

Returns
-------

columns: list
    A list of columns that are correlated to the target column based on the cutoff point
def correlation_columns(dataset: pd.DataFrame, target_column: str, k: float=0.5):
    '\n    Columns that are correlated to the target point\n\n    Parameters\n    ----------\n\n    dataset: pd.DataFrame\n        The pandas dataframe\n    \n    target_column: str\n        The target column to calculate correlation against\n\n    k: float\n        The correlation cuttoff point; defaults to -0.5 and 0.5.\n        The values passed in represents the negative and positive cutofff\n\n    Returns\n    -------\n\n    columns: list\n        A list of columns that are correlated to the target column based on the cutoff point\n    '
    corr = np.abs(dataset.corr()[target_column])
    corr_sorted = corr.sort_values(ascending=False)
    columns = [col for (col, value) in zip(corr_sorted.index, corr_sorted.values) if ((value >= k) and (col != target_column))]
    return columns