text_extensions_for_pandas/io/watson/tables.py
def _convert_labelled_numeric_items(table, exploded_df, row_header_cols, col_header_cols, decimal_pt='.',
                                    cast_type=float):
    """
    converts all elements in the table that are tagged as numeric type to a numeric type
    :param table:           The table to convert, as a pandas DataFrame
    :param exploded_df:     The exploded DataFrame, from last step of reconstruction
    :param row_header_cols: The names of the headers in the exploded dataframe that refer to row headers
    :param col_header_cols: The names of the headers in the exploded dataframe that refer to column headers
    :param decimal_pt:      the type of the decimal point being used
    :param cast_type:       The type that the element is to be cast to. Defaults to ``float``
    :return:        the converted DataFrame
    """

    def convert_val(val):
        return _convert_val_to_numeric(val, cast_type, f'[^0-9{decimal_pt}()-]')

    numeric_cells = _generate_is_numeric_table(exploded_df, row_header_cols, col_header_cols)

    for i in range(table.shape[0]):
        table.iloc[i, :][numeric_cells.iloc[i, :]] = table.iloc[i, :][numeric_cells.iloc[i, :]].apply(convert_val)
    return table

    converts all elements in the table that are tagged as numeric type to a numeric type
    :param table:           The table to convert, as a pandas DataFrame
    :param exploded_df:     The exploded DataFrame, from last step of reconstruction
    :param row_header_cols: The names of the headers in the exploded dataframe that refer to row headers
    :param col_header_cols: The names of the headers in the exploded dataframe that refer to column headers
    :param decimal_pt:      the type of the decimal point being used
    :param cast_type:       The type that the element is to be cast to. Defaults to ``float``
    :return:        the converted DataFrame
    
converts all elements in the table that are tagged as numeric type to a numeric type
converts all elements in the table that are tagged as numeric type to a numeric type
def _convert_labelled_numeric_items(table, exploded_df, row_header_cols, col_header_cols, decimal_pt='.',
                                    cast_type=float):
    def convert_val(val):
        return _convert_val_to_numeric(val, cast_type, f'[^0-9{decimal_pt}()-]')
    numeric_cells = _generate_is_numeric_table(exploded_df, row_header_cols, col_header_cols)
    for i in range(table.shape[0]):
        table.iloc[i, :][numeric_cells.iloc[i, :]] = table.iloc[i, :][numeric_cells.iloc[i, :]].apply(convert_val)
    return table
def _convert_labelled_numeric_items ( table , exploded_df , row_header_cols , col_header_cols , decimal_pt = '.' , cast_type = float ) : def convert_val ( val ) : return _convert_val_to_numeric ( val , cast_type , f'[^0-9{decimal_pt}()-]' ) numeric_cells = _generate_is_numeric_table ( exploded_df , row_header_cols , col_header_cols ) for i in range ( table . shape [ 0 ] ) : table . iloc [ i , : ] [ numeric_cells . iloc [ i , : ] ] = table . iloc [ i , : ] [ numeric_cells . iloc [ i , : ] ] . apply ( convert_val ) return table
converts all elements in the table that are tagged as numeric type to a numeric type
converts all elements in the table that are tagged as numeric type to a numeric type
"""
    converts all elements in the table that are tagged as numeric type to a numeric type
    :param table:           The table to convert, as a pandas DataFrame
    :param exploded_df:     The exploded DataFrame, from last step of reconstruction
    :param row_header_cols: The names of the headers in the exploded dataframe that refer to row headers
    :param col_header_cols: The names of the headers in the exploded dataframe that refer to column headers
    :param decimal_pt:      the type of the decimal point being used
    :param cast_type:       The type that the element is to be cast to. Defaults to ``float``
    :return:        the converted DataFrame
    """
the converted DataFrame
the converted DataFrame
table
The table to convert, as a pandas DataFrame
The table to convert as a pandas DataFrame
exploded_df
The exploded DataFrame, from last step of reconstruction
The exploded DataFrame from last step of reconstruction
row_header_cols
The names of the headers in the exploded dataframe that refer to row headers
The names of the headers in the exploded dataframe that refer to row headers
col_header_cols
The names of the headers in the exploded dataframe that refer to column headers
The names of the headers in the exploded dataframe that refer to column headers
decimal_pt
the type of the decimal point being used
the type of the decimal point being used
cast_type
The type that the element is to be cast to. Defaults to ``float``
The type that the element is to be cast to . Defaults to ` ` float ` `