src/04_visualization/census_vis_synthesis.py
def clean_generation_status(gen, year):
        """
        This function cleans the generational status census data
        Args:
            gen (pd.DataFrame): The dataframe for generational status data
            year (int): census year

        Returns:
            gen: A cleaned pandas dataframe
        """

        for i in gen.columns[3:]:
            gen[i] = gen[i] / gen[gen.columns[2]]

        gen = gen.iloc[:, [1, 3, 4, 5]]

        return gen

        This function cleans the generational status census data
        Args:
            gen (pd.DataFrame): The dataframe for generational status data
            year (int): census year

        Returns:
            gen: A cleaned pandas dataframe
        
This function cleans the generational status census data
This function cleans the generational status census data
def clean_generation_status(gen, year):
        for i in gen.columns[3:]:
            gen[i] = gen[i] / gen[gen.columns[2]]
        gen = gen.iloc[:, [1, 3, 4, 5]]
        return gen
def clean_generation_status ( gen , year ) : for i in gen . columns [ 3 : ] : gen [ i ] = gen [ i ] / gen [ gen . columns [ 2 ] ] gen = gen . iloc [ : , [ 1 , 3 , 4 , 5 ] ] return gen
This function cleans the generational status census data
This function cleans the generational status census data
"""
        This function cleans the generational status census data
        Args:
            gen (pd.DataFrame): The dataframe for generational status data
            year (int): census year

        Returns:
            gen: A cleaned pandas dataframe
        """
A cleaned pandas dataframe
A cleaned pandas dataframe
gen
gen
The dataframe for generational status data
The dataframe for generational status data
year
None