def label(data, column):
    """ Performs label encoding.

        Example:
            Color: ['blue', 'green', 'blue', 'pink']
            is encoded by
            Color: [1, 2, 1, 3]

        :param data: Data
        :param column: Column to encode
        :return: Encoded data
        :rtype: pd.DataFrame
    """
    data[column] = data[column].astype('category').cat.codes
    return data
