0

It comes out well in the histplot, but it doesn't draw well in the distplot.

sns.histplot(df[target]) the histplot looks okay

sns.distplot(df[target]) the distplot is just a flat line

Matt Hall
  • 7,614
  • 1
  • 23
  • 36
형한결
  • 83
  • 3

2 Answers2

1

Your x range of values is huge! sns.dist() plots the distribution probability meaning the sum will equal to 1. So essentially with this huge magnitude of your x values, you'll have very small probability values. This and your y graph range is -1 to 1. If you change your y range, you should get something closer to what you'd expect to see.

So change your y scale to something like:

sns.distplot(df[target])
plt.ylim(0, .1**27)
chitown88
  • 27,527
  • 4
  • 30
  • 59
1

Please try sns.displot(data=df, x="target", kde=True)

or sns.displot(data=df, x="target", kind="kde")

Sammiti Yadav
  • 78
  • 1
  • 6