Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gvyshnya/72975ad17ee728e5483e6f69aa3af4fb to your computer and use it in GitHub Desktop.
Save gvyshnya/72975ad17ee728e5483e6f69aa3af4fb to your computer and use it in GitHub Desktop.
Visualizing missing values
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