def pn_from_dataframe(dataframe, data_column, pos_class):
    """
    Function to generate random positive-negative data from any pandas dataframe. It returns the same dataset with a 'y' column containing the positive-negative data.

    REQUIRED

    dataframe: pandas.Dataframe to be extracted to positive-negative.
    data_column: dataframe column to be compared to extract the positive class.
    pos_class: class in the data_column to be considered as positive.

    OPTIONAL

    pos_size: positive rate (if between 0 and 1) or positive literal number (greater than one).
    pos_size will default to 0.8 if no value is specified.
    """
    dataframe = dataframe.sample(frac=1).reset_index(drop=True)
    for index, value in enumerate(dataframe.loc[:, (data_column)]):
        if value == pos_class:
            dataframe.loc[index, 'y'] = 1
        else:
            dataframe.loc[index, 'y'] = -1
    return dataframe
