notebooks/common.py
def clean(table: pd.DataFrame) -> pd.DataFrame:
    """Clean the extracted data tables."""
    
    t = table.copy()
    t = remove_event_rows(t)
    t = drop_empty(t)
    t = fix_numerical_cols(t)
    t = fix_column_names(t)
    t = remove_footnotes(t)
    t = middle_date(t)
    t = t.set_index(('Mean Date', ''))
    t = t.sort_index(ascending=True)
    # Note we keep the hierarchical index at this point
    # because it makes the checking row additions simpler
    
    return t
Clean the extracted data tables.
Clean the extracted data tables.
Clean the extracted data tables .
def clean(table: pd.DataFrame) -> pd.DataFrame:
    t = table.copy()
    t = remove_event_rows(t)
    t = drop_empty(t)
    t = fix_numerical_cols(t)
    t = fix_column_names(t)
    t = remove_footnotes(t)
    t = middle_date(t)
    t = t.set_index(('Mean Date', ''))
    t = t.sort_index(ascending=True)
    return t
def clean ( table : pd . DataFrame ) -> pd . DataFrame : t = table . copy ( ) t = remove_event_rows ( t ) t = drop_empty ( t ) t = fix_numerical_cols ( t ) t = fix_column_names ( t ) t = remove_footnotes ( t ) t = middle_date ( t ) t = t . set_index ( ( 'Mean Date' , '' ) ) t = t . sort_index ( ascending = True ) return t
Clean the extracted data tables.
Clean the extracted data tables .
"""Clean the extracted data tables.""" # Note we keep the hierarchical index at this point # because it makes the checking row additions simpler
table
pd.DataFrame