📜  def plot_null_matrix(df, figsize=(18,15)): # 启动图形 plt.figure(figsize=figsize) # 根据值是否为布尔数据框 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:56.070000             🧑  作者: Mango

代码示例1
def plot_null_matrix(df, figsize=(18,15)):    
    # initiate the figure    
    plt.figure(figsize=figsize)    
    # create a boolean dataframe based on whether values are null    
    df_null = df.isnull()    
    # create a heatmap of the boolean dataframe    
    sns.heatmap(~df_null, cbar=False, yticklabels=False)    
    plt.show()