/missing_values.py Secret
Last active
November 19, 2020 18:54
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 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