I'm getting an error in python seaborn : AttributeError: Rectangle.set() got an unexpected keyword argument 'hist'

Question:

My code:

sns.displot(df["sex"], hist=False)
plt.show()

I expected a converted histogram graph with no bars.

Answers:

You’re using old reference of function seaborn.distplot. It has been deprecated.

Use sns.kdeplot(df["sex"])
or sns.displot(df["sex"], kind="kde")

There is no hist parameter in displot() function.

here is the definition:

seaborn.displot(data=None, *, x=None, y=None, hue=None, row=None, col=None, weights=None, kind='hist', rug=False, rug_kws=None, log_scale=None, legend=True, palette=None, hue_order=None, hue_norm=None, color=None, col_wrap=None, row_order=None, col_order=None, height=5, aspect=1, facet_kws=None, **kwargs)

Link to doc:

https://seaborn.pydata.org/generated/seaborn.displot.html

Answered By: God Is One
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.