src/04_visualization/census_vis_synthesis.py
def clean_industry(ind, year):
        """
        This function cleans the work industry census data
        Args:
            ind (pd.DataFrame): The dataframe for industry data
            year (int): census year

        Returns:
            ind: A cleaned pandas dataframe
        """

        col_lis = list(ind.columns)[5:]
        for col in col_lis:
            ind[col] = ind[col]/ind['total']

        ind['Industry - Not applicable'] = ind[
            'Industry - Not applicable'] / ind['total']

        ind.drop(columns=['All industries',
                          'Unnamed: 0',
                          'total'], inplace=True)

        return ind

        This function cleans the work industry census data
        Args:
            ind (pd.DataFrame): The dataframe for industry data
            year (int): census year

        Returns:
            ind: A cleaned pandas dataframe
        
This function cleans the work industry census data
This function cleans the work industry census data
def clean_industry(ind, year):
        col_lis = list(ind.columns)[5:]
        for col in col_lis:
            ind[col] = ind[col]/ind['total']
        ind['Industry - Not applicable'] = ind[
            'Industry - Not applicable'] / ind['total']
        ind.drop(columns=['All industries',
                          'Unnamed: 0',
                          'total'], inplace=True)
        return ind
def clean_industry ( ind , year ) : col_lis = list ( ind . columns ) [ 5 : ] for col in col_lis : ind [ col ] = ind [ col ] / ind [ 'total' ] ind [ 'Industry - Not applicable' ] = ind [ 'Industry - Not applicable' ] / ind [ 'total' ] ind . drop ( columns = [ 'All industries' , 'Unnamed: 0' , 'total' ] , inplace = True ) return ind
This function cleans the work industry census data
This function cleans the work industry census data
"""
        This function cleans the work industry census data
        Args:
            ind (pd.DataFrame): The dataframe for industry data
            year (int): census year

        Returns:
            ind: A cleaned pandas dataframe
        """
A cleaned pandas dataframe
A cleaned pandas dataframe
ind
ind
The dataframe for industry data
The dataframe for industry data
year
None