I need to plot the count plot for a data set which has blank values.
I tried using
sns.countplot(x='ViolLevel',data=df1)
But this produces a plot:
which does not show the count of the null values (29740) in the data. (I find the number of null values using df1['ViolLevel'].isnull().sum()
)
How can I include the nan
values in my count plot?
You can just replace the null values in your dataset with a string and run the plot again:
df1.ViolLevel.fillna('Null', inplace=True)