packages/vaex-ml/vaex/ml/transformations.py
def transform(self, df):
        '''Transform a DataFrame with a fitted OneHotEncoder.

        :param df: A vaex DataFrame.
        :return: A shallow copy of the DataFrame that includes the encodings.
        :rtype: DataFrame
        '''
        copy = df.copy()
        # for each feature, add a virtual column for each unique entry
        for i, feature in enumerate(self.features):
            for j, value in enumerate(self.uniques_[i]):
                column_name = self.prefix + feature + '_' + str(value)
                copy.add_virtual_column(column_name, 'where({feature} == {value}, {one}, {zero})'.format(
                                        feature=feature, value=repr(value), one=self.one, zero=self.zero))
        return copy
Transform a DataFrame with a fitted OneHotEncoder.

        :param df: A vaex DataFrame.
        :return: A shallow copy of the DataFrame that includes the encodings.
        :rtype: DataFrame
        
Transform a DataFrame with a fitted OneHotEncoder.
Transform a DataFrame with a fitted OneHotEncoder .
def transform(self, df):
        copy = df.copy()
        for i, feature in enumerate(self.features):
            for j, value in enumerate(self.uniques_[i]):
                column_name = self.prefix + feature + '_' + str(value)
                copy.add_virtual_column(column_name, 'where({feature} == {value}, {one}, {zero})'.format(
                                        feature=feature, value=repr(value), one=self.one, zero=self.zero))
        return copy
def transform ( self , df ) : copy = df . copy ( ) for i , feature in enumerate ( self . features ) : for j , value in enumerate ( self . uniques_ [ i ] ) : column_name = self . prefix + feature + '_' + str ( value ) copy . add_virtual_column ( column_name , 'where({feature} == {value}, {one}, {zero})' . format ( feature = feature , value = repr ( value ) , one = self . one , zero = self . zero ) ) return copy
Transform a DataFrame with a fitted OneHotEncoder.
Transform a DataFrame with a fitted OneHotEncoder .
'''Transform a DataFrame with a fitted OneHotEncoder.

        :param df: A vaex DataFrame.
        :return: A shallow copy of the DataFrame that includes the encodings.
        :rtype: DataFrame
        ''' # for each feature, add a virtual column for each unique entry
A shallow copy of the DataFrame that includes the encodings.
A shallow copy of the DataFrame that includes the encodings .
DataFrame
self
df
A vaex DataFrame.
A vaex DataFrame .