PythonDataScienceHandbook icon indicating copy to clipboard operation
PythonDataScienceHandbook copied to clipboard

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

Open ivlmag opened this issue 2 years ago • 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)

ivlmag avatar Apr 26 '22 12:04 ivlmag