text_extensions_for_pandas/io/watson/tables.py
def _explode_indexes(df, axis_type, drop_original=False):
    """
    Performs an operation similar to explode, but uses the index of the cell as the differentiator.
    :param df: the input dataframe of body cells
    :param axis_type: either ``"row"`` or ``"column"``, determining which axis to be operating on.
    :param drop_original: Whether or not to drop the original column. Defaults to false

    :return: the original dataframe, modified as expected, and the name of the column created.
    """
    df[f'{axis_type}_index'] = [list(range(r[f"{axis_type}_index_begin"], r[f"{axis_type}_index_end"] + 1)) for _, r in
                                df.iterrows()]
    df = df.explode(f'{axis_type}_index')

    if drop_original:
        df.drop(columns=f"{axis_type}_index_begin", inplace=True)
    return df, [f'{axis_type}_index']

    Performs an operation similar to explode, but uses the index of the cell as the differentiator.
    :param df: the input dataframe of body cells
    :param axis_type: either ``"row"`` or ``"column"``, determining which axis to be operating on.
    :param drop_original: Whether or not to drop the original column. Defaults to false

    :return: the original dataframe, modified as expected, and the name of the column created.
    
Performs an operation similar to explode, but uses the index of the cell as the differentiator.
Performs an operation similar to explode but uses the index of the cell as the differentiator .
def _explode_indexes(df, axis_type, drop_original=False):
    df[f'{axis_type}_index'] = [list(range(r[f"{axis_type}_index_begin"], r[f"{axis_type}_index_end"] + 1)) for _, r in
                                df.iterrows()]
    df = df.explode(f'{axis_type}_index')
    if drop_original:
        df.drop(columns=f"{axis_type}_index_begin", inplace=True)
    return df, [f'{axis_type}_index']
def _explode_indexes ( df , axis_type , drop_original = False ) : df [ f'{axis_type}_index' ] = [ list ( range ( r [ f"{axis_type}_index_begin" ] , r [ f"{axis_type}_index_end" ] + 1 ) ) for _ , r in df . iterrows ( ) ] df = df . explode ( f'{axis_type}_index' ) if drop_original : df . drop ( columns = f"{axis_type}_index_begin" , inplace = True ) return df , [ f'{axis_type}_index' ]
Performs an operation similar to explode, but uses the index of the cell as the differentiator.
Performs an operation similar to explode but uses the index of the cell as the differentiator .
"""
    Performs an operation similar to explode, but uses the index of the cell as the differentiator.
    :param df: the input dataframe of body cells
    :param axis_type: either ``"row"`` or ``"column"``, determining which axis to be operating on.
    :param drop_original: Whether or not to drop the original column. Defaults to false

    :return: the original dataframe, modified as expected, and the name of the column created.
    """
the original dataframe, modified as expected, and the name of the column created.
the original dataframe modified as expected and the name of the column created .
df
the input dataframe of body cells
the input dataframe of body cells
axis_type
either ``"row"`` or ``"column"``, determining which axis to be operating on.
either ` ` " row " ` ` or ` ` " column " ` ` determining which axis to be operating on .
drop_original
Whether or not to drop the original column. Defaults to false
Whether or not to drop the original column . Defaults to false