explore.py
def corr_heatmap(train):
    '''
    This function creates a heatmap of the correlation of all features.
    Takes in a DataFrame as an argument.
    '''
    # put popularity in first position
    heatmap_data = train
    first_col = heatmap_data.pop("popularity")
    heatmap_data.insert(0, "popularity", first_col)

    # create correlation heatmap
    corr = heatmap_data.corr()
    mask = np.triu(np.ones_like(corr, dtype=bool))
    ax = sns.heatmap(corr, mask=mask, center=0, cmap=sns.diverging_palette(95, 220, n=250, s=93, l=35), square=True) 
    ax.set_xticklabels(ax.get_xticklabels(), rotation=45, horizontalalignment='right')
    ax.set_yticklabels(ax.get_yticklabels(), rotation=0, horizontalalignment='right')
    plt.title('Which features have significant linear correlation?')
    ax

    This function creates a heatmap of the correlation of all features.
    Takes in a DataFrame as an argument.
    
This function creates a heatmap of the correlation of all features.
Takes in a DataFrame as an argument.
This function creates a heatmap of the correlation of all features . Takes in a DataFrame as an argument .
def corr_heatmap(train):
    heatmap_data = train
    first_col = heatmap_data.pop("popularity")
    heatmap_data.insert(0, "popularity", first_col)
    corr = heatmap_data.corr()
    mask = np.triu(np.ones_like(corr, dtype=bool))
    ax = sns.heatmap(corr, mask=mask, center=0, cmap=sns.diverging_palette(95, 220, n=250, s=93, l=35), square=True) 
    ax.set_xticklabels(ax.get_xticklabels(), rotation=45, horizontalalignment='right')
    ax.set_yticklabels(ax.get_yticklabels(), rotation=0, horizontalalignment='right')
    plt.title('Which features have significant linear correlation?')
    ax
def corr_heatmap ( train ) : heatmap_data = train first_col = heatmap_data . pop ( "popularity" ) heatmap_data . insert ( 0 , "popularity" , first_col ) corr = heatmap_data . corr ( ) mask = np . triu ( np . ones_like ( corr , dtype = bool ) ) ax = sns . heatmap ( corr , mask = mask , center = 0 , cmap = sns . diverging_palette ( 95 , 220 , n = 250 , s = 93 , l = 35 ) , square = True ) ax . set_xticklabels ( ax . get_xticklabels ( ) , rotation = 45 , horizontalalignment = 'right' ) ax . set_yticklabels ( ax . get_yticklabels ( ) , rotation = 0 , horizontalalignment = 'right' ) plt . title ( 'Which features have significant linear correlation?' ) ax
This function creates a heatmap of the correlation of all features.
This function creates a heatmap of the correlation of all features .
'''
    This function creates a heatmap of the correlation of all features.
    Takes in a DataFrame as an argument.
    ''' # put popularity in first position # create correlation heatmap
train