Click here to Skip to main content
15,606,999 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wrote a function to visualize the missing values of a dataframe using 'Plotly' visualization library. I then tried saving the output in a HTML file, but ended up with this error -->


AttributeError: 'AxesSubplot' object has no attribute 'write_html'




Where have I gone wrong?

What I have tried:

#Imports
from statistics import correlation
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import missingno as msno
import plotly.express as px
import chart_studio.plotly as py
import plotly.graph_objects as go



def dynamic_manual_eda(eda_file):
    
    # Visualizing missing values
        miss_viz=msno.heatmap(eda_file, cmap="RdYlGn", figsize=(10,5), 
        fontsize=12);
        
        miss_plot=miss_viz.write_html("templates/missing_viz.html")
        
        return miss_plot  

eda_file = pd.read_csv('C:/Users/Churn_bank.csv')

dynamic_manual_eda(eda_file)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900