Skip to content

Instantly share code, notes, and snippets.

@pr2tik1
Created May 22, 2020 16:59
Show Gist options
  • Save pr2tik1/3b306cf01f6f49d53b246ffb73151c74 to your computer and use it in GitHub Desktop.
Save pr2tik1/3b306cf01f6f49d53b246ffb73151c74 to your computer and use it in GitHub Desktop.
def plot_missing(self,png=False):
"""
Function to plot Missing data in the dataframe
Input: dataframe
Output: Bar-Plot
"""
missing_data = self.data.isnull().sum()
missing_df = pd.DataFrame(missing_data.drop(missing_data[missing_data == 0].index).sort_values(ascending=False),
columns = ['values'])
fig = px.bar(data_frame = missing_df, x = missing_df.index, y = missing_df.values, text =missing_df.values,
title = "Missing values count")
if png:
fig.show('png')
else:
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment