(self, idx)
return func_lines
Generate main code lines for df.getitem with idx of slice
Generate main code lines for df.getitem with idx of slice
Generate main code lines for df . getitem with idx of slice
def df_getitem_slice_idx_main_codelines(self, idx):
    """Generate main code lines for df.getitem with idx of slice"""

    types_order = get_structure_maps(self.data, self.columns)[2]
    n_lists = len(types_order)

    results = []
    func_lines = []
    for i in range(n_lists):
        func_lines += [
            f'  list_{i} = self._data[{i}].copy()',
            f'  for i, item in enumerate(list_{i}):',
            f'    list_{i}[i] = item[idx]'
        ]

    all_lists_joined = ', '.join([f'list_{i}' for i in range(n_lists)]) + ', '
    res_data = f'({all_lists_joined})' if n_lists > 0 else '()'
    func_lines += [
        f'  res_data = {res_data}',
        f'  res_index = self._index[idx]',
        f'  return init_dataframe_internal(res_data, res_index, df_type)'
    ]

    return func_lines
def df_getitem_slice_idx_main_codelines ( self , idx ) : types_order = get_structure_maps ( self . data , self . columns ) [ 2 ] n_lists = len ( types_order ) results = [ ] func_lines = [ ] for i in range ( n_lists ) : func_lines += [ f'  list_{i} = self._data[{i}].copy()' , f'  for i, item in enumerate(list_{i}):' , f'    list_{i}[i] = item[idx]' ] all_lists_joined = ', ' . join ( [ f'list_{i}' for i in range ( n_lists ) ] ) + ', ' res_data = f'({all_lists_joined})' if n_lists > 0 else '()' func_lines += [ f'  res_data = {res_data}' , f'  res_index = self._index[idx]' , f'  return init_dataframe_internal(res_data, res_index, df_type)' ] return func_lines