Created
August 4, 2020 07:49
-
-
Save gvyshnya/72975ad17ee728e5483e6f69aa3af4fb to your computer and use it in GitHub Desktop.
Visualizing missing values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import seaborn as sns | |
import plotly.express as px | |
import plotly.graph_objects as go | |
import matplotlib.pyplot as plt | |
# Missing value summary | |
nan_columns = [] | |
nan_values = [] | |
for column in df.columns: | |
nan_columns.append(column) | |
nan_values.append(df[column].isnull().sum()) | |
fig = go.Figure(go.Bar( | |
x=nan_columns, | |
y=nan_values, | |
orientation='v')) | |
fig.update_layout( | |
title='Missing Values in the Attributes', | |
xaxis_title="Column names", | |
yaxis_title="Number of Missing values" | |
) | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment