INNER CODE UNIT · Python

discrete_var_barplot

ashishpatel26/Amazing-Feature-Engineering · data_exploration/explore.py:64

def discrete_var_barplot(x,y,data,output_path=None):
    """draw the barplot of a discrete variable x against y(target variable). 
    By default the bar shows the mean value of y.

    Parameters
    ----------


    Returns
    -------
    figure save as PNG
    """
    
    plt.figure(figsize=(15,10))
    sns.barplot(x=x,y=y,data=data)
    if output_path is not None:
        output = os.path.join(output_path,'Barplot_'+str(x)+'_'+str(y)+'.png')
        plt.savefig(output)   

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…