Created
May 22, 2020 16:59
-
-
Save pr2tik1/3b306cf01f6f49d53b246ffb73151c74 to your computer and use it in GitHub Desktop.
This file contains 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
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