Skip to content

Instantly share code, notes, and snippets.

@anisdismail
Last active November 19, 2020 18:54
import matplotlib.pyplot as plt
#generate the percentages of missing values sorted from the highest to lowest
null_perc=((muon_hits_df.isnull().
sum()/muon_hits_df.
shape[0]
)*100).sort_values(ascending=False)
#create a figure object to specify the figure size and axes' labels
fig = plt.figure(figsize = (10,5))
ax = fig.gca()
ax.set_xlabel("features names")
ax.set_ylabel("missing values percentage")
#generate the bar graph
null_perc.plot.bar(ax=ax)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment