I have searched S/O but I couldn't find a answer for this.
When I try to plot a distribution plot using seaborn I am getting a futurewarning. I was wondering what could be the issue here.
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
% matplotlib inline
from sklearn import datasets
iris = datasets.load_iris()
df = pd.DataFrame(iris.data, columns=iris.feature_names)
df['class'] = iris.target
df['species'] = df['class'].map({idx:s for idx, s in enumerate(iris.target_names)})
fig, ((ax1,ax2),(ax3,ax4))= plt.subplots(2,2, figsize =(13,9))
sns.distplot(a = df.iloc[:,0], ax=ax1)
sns.distplot(a = df.iloc[:,1], ax=ax2)
sns.distplot(a = df.iloc[:,2], ax=ax3)
sns.distplot(a = df.iloc[:,3], ax=ax4)
plt.show()
This is the warning:
C:\ProgramData\Anaconda3\lib\site-packages\scipy\stats\stats.py:1713:
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
Any help? You can run the above code. You'll get the warning.
Pandas : 0.23.4
, seaborn : 0.9.0
, matplotlib : 2.2.3
, scipy : 1.1.0
, numpy: 1.15.0'
0.23.4
and seaborn :0.9.0
, matplotlib :2.2.3
, scipy :1.1.0
, numpy :1.15.0'
– Dgsns.kdeplot(data = [1,3,4])
. This is hence a problem somewhere in seaborn I suppose. – Disagree