(self, idx)
return func_text, global_vars
Example of generated implementation:
        def _df_getitem_list_iloc_impl(self, idx):
          check_idx = False
          for i in idx:
            if -1 < i < len(self._dataframe.index):
              check_idx = True
          if check_idx == True:
            data_0 = pandas.Series(self._dataframe._data[0][0])
            result_0 = data_0.iloc[numpy.array(idx)]
            data_1 = pandas.Series(self._dataframe._data[0][1])
            result_1 = data_1.iloc[numpy.array(idx)]
            data_2 = pandas.Series(self._dataframe._data[1][0])
            result_2 = data_2.iloc[numpy.array(idx)]
            return pandas.DataFrame(data={"A": result_0, "B": result_1, "C": result_2}, index=idx)
          raise IndexingError('Index is out of bounds for axis')
Example of generated implementation:
        def _df_getitem_list_iloc_impl(self, idx):
          check_idx = False
          for i in idx:
            if -1 < i < len(self._dataframe.index):
              check_idx = True
          if check_idx == True:
            data_0 = pandas.Series(self._dataframe._data[0][0])
            result_0 = data_0.iloc[numpy.array(idx)]
            data_1 = pandas.Series(self._dataframe._data[0][1])
            result_1 = data_1.iloc[numpy.array(idx)]
            data_2 = pandas.Series(self._dataframe._data[1][0])
            result_2 = data_2.iloc[numpy.array(idx)]
            return pandas.DataFrame(data={"A": result_0, "B": result_1, "C": result_2}, index=idx)
          raise IndexingError('Index is out of bounds for axis')
Example of generated implementation : def _df_getitem_list_iloc_impl ( self idx ) : check_idx = False for i in idx : if - 1 < i < len ( self . _dataframe . index ) : check_idx = True if check_idx == True : data_0 = pandas . Series ( self . _dataframe . _data [ 0 ] [ 0 ] ) result_0 = data_0 . iloc [ numpy . array ( idx ) ] data_1 = pandas . Series ( self . _dataframe . _data [ 0 ] [ 1 ] ) result_1 = data_1 . iloc [ numpy . array ( idx ) ] data_2 = pandas . Series ( self . _dataframe . _data [ 1 ] [ 0 ] ) result_2 = data_2 . iloc [ numpy . array ( idx ) ] return pandas . DataFrame ( data = { A : result_0 B : result_1 C : result_2 } index = idx ) raise IndexingError ( Index is out of bounds for axis )
def df_getitem_list_iloc_codegen(self, idx):
    """
    Example of generated implementation:
        def _df_getitem_list_iloc_impl(self, idx):
          check_idx = False
          for i in idx:
            if -1 < i < len(self._dataframe.index):
              check_idx = True
          if check_idx == True:
            data_0 = pandas.Series(self._dataframe._data[0][0])
            result_0 = data_0.iloc[numpy.array(idx)]
            data_1 = pandas.Series(self._dataframe._data[0][1])
            result_1 = data_1.iloc[numpy.array(idx)]
            data_2 = pandas.Series(self._dataframe._data[1][0])
            result_2 = data_2.iloc[numpy.array(idx)]
            return pandas.DataFrame(data={"A": result_0, "B": result_1, "C": result_2}, index=idx)
          raise IndexingError('Index is out of bounds for axis')
    """
    func_lines = ['def _df_getitem_list_iloc_impl(self, idx):',
                  '  check_idx = False',
                  '  for i in idx:',
                  '    if -1 < i < len(self._dataframe.index):',
                  '      check_idx = True',
                  '  if check_idx == True:']
    results = []
    index = '[self._dataframe._index[i] for i in idx]'
    if isinstance(self.index, PositionalIndexType):
        index = 'idx'
    for i, c in enumerate(self.columns):
        col_loc = self.column_loc[c]
        type_id, col_id = col_loc.type_id, col_loc.col_id
        result_c = f"result_{i}"
        func_lines += [f"    data_{i} = pandas.Series(self._dataframe._data[{type_id}][{col_id}])",
                       f"    {result_c} = data_{i}.iloc[numpy.array(idx)]"]
        results.append((c, result_c))
    data = ', '.join(f'"{col}": {data}' for col, data in results)
    func_lines += [f"    return pandas.DataFrame(data={{{data}}}, index={index})",
                   f"  raise IndexingError('Index is out of bounds for axis')"]

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

    return func_text, global_vars
def df_getitem_list_iloc_codegen ( self , idx ) : func_lines = [ 'def _df_getitem_list_iloc_impl(self, idx):' , '  check_idx = False' , '  for i in idx:' , '    if -1 < i < len(self._dataframe.index):' , '      check_idx = True' , '  if check_idx == True:' ] results = [ ] index = '[self._dataframe._index[i] for i in idx]' if isinstance ( self . index , PositionalIndexType ) : index = 'idx' for i , c in enumerate ( self . columns ) : col_loc = self . column_loc [ c ] type_id , col_id = col_loc . type_id , col_loc . col_id result_c = f"result_{i}" func_lines += [ f"    data_{i} = pandas.Series(self._dataframe._data[{type_id}][{col_id}])" , f"    {result_c} = data_{i}.iloc[numpy.array(idx)]" ] results . append ( ( c , result_c ) ) data = ', ' . join ( f'"{col}": {data}' for col , data in results ) func_lines += [ f"    return pandas.DataFrame(data={{{data}}}, index={index})" , f"  raise IndexingError('Index is out of bounds for axis')" ] func_text = '\n' . join ( func_lines ) global_vars = { 'pandas' : pandas , 'numpy' : numpy , 'IndexingError' : IndexingError } return func_text , global_vars