churn_library.py
def perform_eda(data_df):
    '''
    perform eda on data_df and save figures to images folder
    input:
        data_df: pandas dataframe

    output:
        None
    '''

    Column = namedtuple("Column", ['col_name', 'is_categorical'])

    columns = []
    cat_col_names = ['Churn', 'Marital_Status']
    quant_col_names = ['Customer_Age', 'Total_Trans_Ct']

    columns.extend([Column(col_name, True) for col_name in cat_col_names])
    columns.extend([Column(col_name, False) for col_name in quant_col_names])

    for column in columns:
        column_name = column.col_name
        is_categorical = column.is_categorical
        filename = f'{column_name.lower()}_distribution.png'
        output_path = os.path.join(*['images', 'eda', filename])

        _plot_and_save(data_df, column_name, is_categorical, output_path)

    # Generate heatmap and save
    output_path = os.path.join(*['images', 'eda', 'heatmap.png'])
    _heatmap(data_df, output_path)

    perform eda on data_df and save figures to images folder
    input:
        data_df: pandas dataframe

    output:
        None
    
perform eda on data_df and save figures to images folder
input:
data_df: pandas dataframe

None
perform eda on data_df and save figures to images folder input : data_df : pandas dataframe None
def perform_eda(data_df):
    Column = namedtuple("Column", ['col_name', 'is_categorical'])
    columns = []
    cat_col_names = ['Churn', 'Marital_Status']
    quant_col_names = ['Customer_Age', 'Total_Trans_Ct']
    columns.extend([Column(col_name, True) for col_name in cat_col_names])
    columns.extend([Column(col_name, False) for col_name in quant_col_names])
    for column in columns:
        column_name = column.col_name
        is_categorical = column.is_categorical
        filename = f'{column_name.lower()}_distribution.png'
        output_path = os.path.join(*['images', 'eda', filename])
        _plot_and_save(data_df, column_name, is_categorical, output_path)
    output_path = os.path.join(*['images', 'eda', 'heatmap.png'])
    _heatmap(data_df, output_path)
def perform_eda ( data_df ) : Column = namedtuple ( "Column" , [ 'col_name' , 'is_categorical' ] ) columns = [ ] cat_col_names = [ 'Churn' , 'Marital_Status' ] quant_col_names = [ 'Customer_Age' , 'Total_Trans_Ct' ] columns . extend ( [ Column ( col_name , True ) for col_name in cat_col_names ] ) columns . extend ( [ Column ( col_name , False ) for col_name in quant_col_names ] ) for column in columns : column_name = column . col_name is_categorical = column . is_categorical filename = f'{column_name.lower()}_distribution.png' output_path = os . path . join ( * [ 'images' , 'eda' , filename ] ) _plot_and_save ( data_df , column_name , is_categorical , output_path ) output_path = os . path . join ( * [ 'images' , 'eda' , 'heatmap.png' ] ) _heatmap ( data_df , output_path )
perform eda on data_df and save figures to images folder
input:
data_df: pandas dataframe
perform eda on data_df and save figures to images folder input : data_df : pandas dataframe
'''
    perform eda on data_df and save figures to images folder
    input:
        data_df: pandas dataframe

    output:
        None
    ''' # Generate heatmap and save
data_df