'seaborn displot IndexError: tuple index out of range
After a long time, yesterday I started reviewing some old codes using seaborn. However, I started having issues evrytime I use distplot/displot, as I always get error message about some error like this:
a=sns.load_dataset('iris')
sns.displot(data=a,x='sepal_length',kind='kde')
and I get this message:
****Traceback (most recent call last): File "<pyshell#2>", line 1, in sns.displot(data=a,x='sepal_length',kind='kde') File "C:\Users...\AppData\Local\Programs\Python\Python37\lib\site-packages\seaborn\distributions.py", line 2299, in displot p.plot_univariate_density(**kde_kws) File "C:\Users...\AppData\Local\Programs\Python\Python37\lib\site-packages\seaborn\distributions.py", line 1019, in plot_univariate_density artist, = ax.plot(support, density, **artist_kws) File "C:\Users...\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\axes_axes.py", line 1666, in plot lines = [self._get_lines(args, data=data, kwargs)] File "C:\Users...\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\axes_base.py", line 225, in call yield from self._plot_args(this, kwargs) File "C:\Users...\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\axes_base.py", line 399, in _plot_args ncx, ncy = x.shape[1], y.shape[1] IndexError: tuple index out of range
I recently updated seaborn to last version (0.11.2) but I don't know if it's related to this attitude. Consider that if I repeat the example above without adding kind= 'kde' or other inputs, it works. Unfortunately this was a code used to work before. Do u think I have to delete last version in favour of an older one?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
