FAQ: Learn Seaborn: Distributions - KDE Plots, Part II

This community-built FAQ covers the “KDE Plots, Part II” exercise from the lesson “Learn Seaborn: Distributions”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Data Science

Data Visualization in Python

FAQs on the exercise KDE Plots, Part II

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Most of the Seaborn lessons have deprecated code, making it impossible to progress through the lesson. The answer to the question, and even copy-pasting the Solution to run again, will result in an error.

/usr/local/lib/python3.5/dist-packages/scipy/stats/stats.py:1633: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq] . In the future this will be interpreted as an array index, arr[np.array(seq)] , which will result either in an error or a different result. return np.add.reduce(sorted[indexer] * weights, axis=axis) / sumval {“passed”: true}

7 Likes

Confirmed. Seaborn is grounding in shallow water

what is the meaning of this code and why n is taken as 500?

n=500

df = pd.DataFrame({

"label": ["set_one"] * n + ["set_two"] * n + ["set_three"] * n + ["set_four"] * n,

"value": np.concatenate([set_one, set_two, set_three, set_four])

})

When I run my code I’m getting a KDE plot on the right but no legend. Is anyone else having this problem? The code in the lesson seems to suggest that including plt.legend() before plt.show() includes a legend however my final plot has none.

Some advice would be appreciated.

Cheers
Andy

Hi! It is explained in this thread

Cheers! :slight_smile:

I came here looking to see this, I pulled up the solutions and pasted my code onto the same page and used cntl+f after highlighting each line to see that they were exactly the same.

I like to make sure i get the green check mark myself to make sure my understanding of a code is complete. but this one was acting fishy. im glad to know its an error with the page. are there any work arounds?