jakevdp/PythonDataScienceHandbook

04.14 Seaborn - Error "If using all scalar values, you must pass an index" in kdeplot

ivlmag opened this issue · 0 comments

This line at 04.14-Visualization-With-Seaborn :

If we pass the full two-dimensional dataset to kdeplot, we will get a two-dimensional visualization of the data:
sns.kdeplot(data)

Gives an error:

If using all scalar values, you must pass an index

To fix the error, more parameters should be added:

sns.kdeplot(data=data, x='x', y='y')

or

sns.kdeplot(data.x, data.y)