(self, key)
return func_text, global_vars
Example of generated implementation:
    def _df_replace_column_impl(self, key, value):
      length = len(self._index)
      if length == 0:
        raise SDCLimitation("Could not set item for DataFrame with empty columns")
      elif length != len(value):
        raise ValueError("Length of values does not match length of index")
      res_index = self._index
      data_0 = value
      res_data_0 = data_0
      data_1 = self._data[1][0]
      res_data_1 = data_1
      return pandas.DataFrame({"A": res_data_0, "C": res_data_1}, index=self._index)
Example of generated implementation:
    def _df_replace_column_impl(self, key, value):
      length = len(self._index)
      if length == 0:
        raise SDCLimitation("Could not set item for DataFrame with empty columns")
      elif length != len(value):
        raise ValueError("Length of values does not match length of index")
      res_index = self._index
      data_0 = value
      res_data_0 = data_0
      data_1 = self._data[1][0]
      res_data_1 = data_1
      return pandas.DataFrame({"A": res_data_0, "C": res_data_1}, index=self._index)
Example of generated implementation : def _df_replace_column_impl ( self key value ) : length = len ( self . _index ) if length == 0 : raise SDCLimitation ( Could not set item for DataFrame with empty columns ) elif length ! = len ( value ) : raise ValueError ( Length of values does not match length of index ) res_index = self . _index data_0 = value res_data_0 = data_0 data_1 = self . _data [ 1 ] [ 0 ] res_data_1 = data_1 return pandas . DataFrame ( { A : res_data_0 C : res_data_1 } index = self . _index )
def df_replace_column_codegen(self, key):
    """
    Example of generated implementation:
    def _df_replace_column_impl(self, key, value):
      length = len(self._index)
      if length == 0:
        raise SDCLimitation("Could not set item for DataFrame with empty columns")
      elif length != len(value):
        raise ValueError("Length of values does not match length of index")
      res_index = self._index
      data_0 = value
      res_data_0 = data_0
      data_1 = self._data[1][0]
      res_data_1 = data_1
      return pandas.DataFrame({"A": res_data_0, "C": res_data_1}, index=self._index)
    """
    func_lines = [f'def _df_replace_column_impl(self, key, value):']
    func_lines += df_replace_column_codelines(self, key)

    func_text = '\n'.join(func_lines)
    global_vars = {'pandas': pandas, 'numpy': numpy,
                   'SDCLimitation': SDCLimitation}

    return func_text, global_vars
def df_replace_column_codegen ( self , key ) : func_lines = [ f'def _df_replace_column_impl(self, key, value):' ] func_lines += df_replace_column_codelines ( self , key ) func_text = '\n' . join ( func_lines ) global_vars = { 'pandas' : pandas , 'numpy' : numpy , 'SDCLimitation' : SDCLimitation } return func_text , global_vars