(self, idx)
return func_text, global_vars
Example of generated implementation:
        def _df_getitem_list_bool_iloc_impl(self, idx):
          if len(self._dataframe.index) == len(idx):
            data_0 = self._dataframe._data[0][0]
            result_0 = pandas.Series(data_0[numpy.array(idx)])
            data_1 = self._dataframe._data[0][1]
            result_1 = pandas.Series(data_1[numpy.array(idx)])
            data_2 = self._dataframe._data[1][0]
            result_2 = pandas.Series(data_2[numpy.array(idx)])
            return pandas.DataFrame(data={"A": result_0,
                                          "B": result_1,
                                          "C": result_2},
                                          index=self._dataframe.index[numpy.array(idx)])
          raise IndexingError('Item wrong length')
Example of generated implementation:
        def _df_getitem_list_bool_iloc_impl(self, idx):
          if len(self._dataframe.index) == len(idx):
            data_0 = self._dataframe._data[0][0]
            result_0 = pandas.Series(data_0[numpy.array(idx)])
            data_1 = self._dataframe._data[0][1]
            result_1 = pandas.Series(data_1[numpy.array(idx)])
            data_2 = self._dataframe._data[1][0]
            result_2 = pandas.Series(data_2[numpy.array(idx)])
            return pandas.DataFrame(data={"A": result_0,
                                          "B": result_1,
                                          "C": result_2},
                                          index=self._dataframe.index[numpy.array(idx)])
          raise IndexingError('Item wrong length')
Example of generated implementation : def _df_getitem_list_bool_iloc_impl ( self idx ) : if len ( self . _dataframe . index ) == len ( idx ) : data_0 = self . _dataframe . _data [ 0 ] [ 0 ] result_0 = pandas . Series ( data_0 [ numpy . array ( idx ) ] ) data_1 = self . _dataframe . _data [ 0 ] [ 1 ] result_1 = pandas . Series ( data_1 [ numpy . array ( idx ) ] ) data_2 = self . _dataframe . _data [ 1 ] [ 0 ] result_2 = pandas . Series ( data_2 [ numpy . array ( idx ) ] ) return pandas . DataFrame ( data = { A : result_0 B : result_1 C : result_2 } index = self . _dataframe . index [ numpy . array ( idx ) ] ) raise IndexingError ( Item wrong length )
def df_getitem_list_bool_iloc_codegen(self, idx):
    """
    Example of generated implementation:
        def _df_getitem_list_bool_iloc_impl(self, idx):
          if len(self._dataframe.index) == len(idx):
            data_0 = self._dataframe._data[0][0]
            result_0 = pandas.Series(data_0[numpy.array(idx)])
            data_1 = self._dataframe._data[0][1]
            result_1 = pandas.Series(data_1[numpy.array(idx)])
            data_2 = self._dataframe._data[1][0]
            result_2 = pandas.Series(data_2[numpy.array(idx)])
            return pandas.DataFrame(data={"A": result_0,
                                          "B": result_1,
                                          "C": result_2},
                                          index=self._dataframe.index[numpy.array(idx)])
          raise IndexingError('Item wrong length')
    """
    func_lines = ['def _df_getitem_list_bool_iloc_impl(self, idx):']
    results = []
    index = 'self._dataframe.index[numpy.array(idx)]'
    func_lines += ['  if len(self._dataframe.index) == len(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} = self._dataframe._data[{type_id}][{col_id}]",
                       f"    {result_c} = pandas.Series(data_{i}[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('Item wrong length')"]

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

    return func_text, global_vars
def df_getitem_list_bool_iloc_codegen ( self , idx ) : func_lines = [ 'def _df_getitem_list_bool_iloc_impl(self, idx):' ] results = [ ] index = 'self._dataframe.index[numpy.array(idx)]' func_lines += [ '  if len(self._dataframe.index) == len(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} = self._dataframe._data[{type_id}][{col_id}]" , f"    {result_c} = pandas.Series(data_{i}[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('Item wrong length')" ] func_text = '\n' . join ( func_lines ) global_vars = { 'pandas' : pandas , 'numpy' : numpy , 'IndexingError' : IndexingError } return func_text , global_vars