kdeplot : UserWarning: Dataset has 0 variance; skipping density estimate

Viewed 8745

While I was trying to plot a seaborn kdeplot, there was an error:

UserWarning: Dataset has 0 variance; skipping density estimate

I don't understand what this means. I also found that if I created a distplot for the x-axis and y-axis, there was no kde curve as well.

with sns.axes_style('white'):
    plot = sns.jointplot(x='Latitude', y='Longitude', data=df, kind="kde", space=0.7, bw_adjust=3)

How can I fix this problem?

1 Answers

1st that is a warning and not an error, the reason for that is some variable either 'Latitude', 'Longitude' must be (a constant number)(not changing)

Edit: so you can give the DataFrame also so that we can see what is the exact problem

Related