Prepare the transformer to convert data and return the processed table.

        Args:
            col(pandas.DataFrame): Data to transform.

        Returns:
            pandas.DataFrame
963065
def transform(self, col):
        
        out = pd.DataFrame(index=col.index)
        out[self.col_name] = col.fillna(self.default_value)
        out[self.new_name] = (pd.notnull(col) * 1).astype(int)
        return out
551395
def prepare(self, data_source):
        
        dataframe = self.__get_dataframe(data_source, use_target=True)
        self.__config.get_data_model().set_features_types_from_dataframe(dataframe)
        dataframe = self.__cleaner.prepare(dataframe)
        return self.__transformer.prepare(dataframe)
1360697
def GetColLabelValue(self, col):
        
        if len(self.dataframe):
            return self.dataframe.columns[col]
        return ''
923891
def to_frame(self):
        
        col_names = _column_names_from_metadata(
            t.metadata for t in self.transactions)

        def trow(t):
            return tz.concatv(
                (t.amount, t.subaccount),
                (t.metadata.get(c) for c in col_names))
        rows = [trow(t) for t in self.transactions]

        if len(rows) == 0:
            return pd.DataFrame(columns=COLS + col_names)

        return pd.DataFrame(rows, columns=COLS + col_names)
1218861
def __extract_col_type_from_tabledata(table_data):
        

        typename_table = {
            typepy.Typecode.INTEGER: "INTEGER",
            typepy.Typecode.REAL_NUMBER: "REAL",
            typepy.Typecode.STRING: "TEXT",
        }

        return dict(
            [
                [col_idx, typename_table.get(col_dp.typecode, "TEXT")]
                for col_idx, col_dp in enumerate(table_data.column_dp_list)
            ]
        )
999753
def reverse_transform(self, col):
        
        if isinstance(col, pd.Series):
            col = col.to_frame()

        output = pd.DataFrame(index=col.index)
        output[self.col_name] = col.apply(self.safe_date, axis=1)

        return output
982866
def keep(self, *cols):
        
        try:
            self.df = self.df[list(cols)]
        except Exception as e:
            self.err(e, "Can not remove colums")
            return
        self.ok("Setting dataframe to columns", " ".join(cols))
228025
def get_col(col)
      col = @col_keys[col]
      col.nil? ? nil : @row_keys.map { |r, ri| [r, @content[ri][col]] }.to_h
    end
474909
def transform(self, col):
        

        out = pd.DataFrame(index=col.index)
        out[self.col_name] = col.apply(self.get_val, axis=1)

        if self.subtype == 'int':
            out[self.col_name] = out[self.col_name].astype(int)

        return out
1341076
def transform(self, column):
        
        self.check_data_type()

        return pd.DataFrame({self.col_name: np.exp(column[self.col_name])})
882560
def column_csv(table_name, col_name):
    
    csv = orca.get_table(table_name).get_column(col_name).to_csv(path=None)
    return csv, 200, {'Content-Type': 'text/csv'}
376822
def table(self, table):
        
        return DataFrame.from_spark_rdd(self.sql_ctx.table(table),
                                        self.sql_ctx)
1033755
def to_tables(cols):
  
  tables = OrderedDict()
  for col in cols:
    tname = col["table_name"]
    if tname not in tables:
      tables[tname] = OrderedDict()
    tables[tname][col["column_name"]] = col
  return tables
1217251
def column(self, col):
        
        if type(col) is str:
            for c in self._cols:
                if c.name == col:
                    return c
        else:
            return self._cols[col]
667602
def transform(self, X):
        

        for col in range(X.shape[1]):
            X[:, col] = self._transform_col(X[:, col], col)

        return X
42391
def _to_seq(sc, cols, converter=None):
    
    if converter:
        cols = [converter(c) for c in cols]
    return sc._jvm.PythonUtils.toSeq(cols)
1213445
def get_column(self, col):
        
        # catch corner case with an empty file (group with no datasets)
        if not len(self.group.keys()):
            return np.array([])
        vals = self.group[col]
        if self.filter_func:
            return vals[self.mask]
        else:
            return vals[:]