<p dir="auto">when numpy is 1.11.3, distplot() is not working,<br>
but under numpy 1.11.1, it's working with warning:</p>
<blockquote>
<p dir="auto">Woking\path\lib\site-packages\statsmodels\nonparametric\kdetools.py:20: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future<br>
y = X[:m/2+1] + np.r_[0,X[m/2+1:],0]*1j</p>
</blockquote>
<p dir="auto">I can't get <code class="notranslate">kdeplot</code> or <code class="notranslate">distplot</code> to work with my <code class="notranslate">pd.Series</code> (or <code class="notranslate">np.array</code>)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="u = np.array([ 3.41959 , 1.79315 , 1.17229 , 1.59909 , 1.27337 , 1.21917 , 2.60591 , 2.0571 , 1.83865 , 1.94869 , 1.65421 , 1.67777 , 1.23781 , 1.46352 , 1.41791 , 2.00387 , 2.51076 , 1.59734 , 1.32982 , 1.89372 , 1.40614 , 1.41747 , 1.34109 , 1.38647 , 1.49432 , 1.05335 , 1.03805 , 1.18631 , 1.06402 , 1.06929 , 1.12031 , 1.07605 , 1.25702 , 1.25158 , 1.06541 , 1.07368 , 1.00559 , 1.00555 , 1.54561 , 1.01144 , 1.79598 , 1.02094 , 1.36236 , 1.6214 , 1.09803 , 1.25866 , 0.987888, 0.993576, 1.25805 , 5.67273 , 1.20665 , 0.985643, 1.07809 , 1.22087 , 1.1201 , 1.0367 , 1.26575 , 1.0295 , 0.993422, 1.08648 , 1.32767 , 1.35376 , 0.98585 , 0.991962, 1.49533 , 1.04997 , 0.995653, 1.13044 , 1.12311 , 1.29017 , 1.6424 , 1.1599 , 1.26453 , 1.0633 , 1.00454 , 1.35529 , 0.990889, 1.19621 , 1.30717 , 1.32321 , 1.5471 , 1.13225 , 1.97847 , 1.17142 , 1.36377 , 2.14062 , 0.996708, 1.03417 , 1.03212 , 1.0082 , 1.06432 , 3.49213 , 4.28245 , 1.00274 , 1.09338 , 1.0156 , 1.13566 , 1.10697 , 1.56438 , 0.96706 ], dtype=float)
Se_u = pd.Series(u)
sns.kdeplot(Se_u)"><pre class="notranslate"><code class="notranslate">u = np.array([ 3.41959 , 1.79315 , 1.17229 , 1.59909 , 1.27337 , 1.21917 , 2.60591 , 2.0571 , 1.83865 , 1.94869 , 1.65421 , 1.67777 , 1.23781 , 1.46352 , 1.41791 , 2.00387 , 2.51076 , 1.59734 , 1.32982 , 1.89372 , 1.40614 , 1.41747 , 1.34109 , 1.38647 , 1.49432 , 1.05335 , 1.03805 , 1.18631 , 1.06402 , 1.06929 , 1.12031 , 1.07605 , 1.25702 , 1.25158 , 1.06541 , 1.07368 , 1.00559 , 1.00555 , 1.54561 , 1.01144 , 1.79598 , 1.02094 , 1.36236 , 1.6214 , 1.09803 , 1.25866 , 0.987888, 0.993576, 1.25805 , 5.67273 , 1.20665 , 0.985643, 1.07809 , 1.22087 , 1.1201 , 1.0367 , 1.26575 , 1.0295 , 0.993422, 1.08648 , 1.32767 , 1.35376 , 0.98585 , 0.991962, 1.49533 , 1.04997 , 0.995653, 1.13044 , 1.12311 , 1.29017 , 1.6424 , 1.1599 , 1.26453 , 1.0633 , 1.00454 , 1.35529 , 0.990889, 1.19621 , 1.30717 , 1.32321 , 1.5471 , 1.13225 , 1.97847 , 1.17142 , 1.36377 , 2.14062 , 0.996708, 1.03417 , 1.03212 , 1.0082 , 1.06432 , 3.49213 , 4.28245 , 1.00274 , 1.09338 , 1.0156 , 1.13566 , 1.10697 , 1.56438 , 0.96706 ], dtype=float)
Se_u = pd.Series(u)
sns.kdeplot(Se_u)
</code></pre></div>
<p dir="auto">This is the error I get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-27-70aaa51b2d69&gt; in &lt;module&gt;()
      4 u = np.array([ 3.41959 , 1.79315 , 1.17229 , 1.59909 , 1.27337 , 1.21917 , 2.60591 , 2.0571 , 1.83865 , 1.94869 , 1.65421 , 1.67777 , 1.23781 , 1.46352 , 1.41791 , 2.00387 , 2.51076 , 1.59734 , 1.32982 , 1.89372 , 1.40614 , 1.41747 , 1.34109 , 1.38647 , 1.49432 , 1.05335 , 1.03805 , 1.18631 , 1.06402 , 1.06929 , 1.12031 , 1.07605 , 1.25702 , 1.25158 , 1.06541 , 1.07368 , 1.00559 , 1.00555 , 1.54561 , 1.01144 , 1.79598 , 1.02094 , 1.36236 , 1.6214 , 1.09803 , 1.25866 , 0.987888, 0.993576, 1.25805 , 5.67273 , 1.20665 , 0.985643, 1.07809 , 1.22087 , 1.1201 , 1.0367 , 1.26575 , 1.0295 , 0.993422, 1.08648 , 1.32767 , 1.35376 , 0.98585 , 0.991962, 1.49533 , 1.04997 , 0.995653, 1.13044 , 1.12311 , 1.29017 , 1.6424 , 1.1599 , 1.26453 , 1.0633 , 1.00454 , 1.35529 , 0.990889, 1.19621 , 1.30717 , 1.32321 , 1.5471 , 1.13225 , 1.97847 , 1.17142 , 1.36377 , 2.14062 , 0.996708, 1.03417 , 1.03212 , 1.0082 , 1.06432 , 3.49213 , 4.28245 , 1.00274 , 1.09338 , 1.0156 , 1.13566 , 1.10697 , 1.56438 , 0.96706 ], dtype=float)
      5 Se_u = pd.Series(u)
----&gt; 6 sns.kdeplot(Se_u)

/Users/jespinoz/anaconda/lib/python3.5/site-packages/seaborn/distributions.py in kdeplot(data, data2, shade, vertical, kernel, bw, gridsize, cut, clip, legend, cumulative, shade_lowest, ax, **kwargs)
    602         ax = _univariate_kdeplot(data, shade, vertical, kernel, bw,
    603                                  gridsize, cut, clip, legend, ax,
--&gt; 604                                  cumulative=cumulative, **kwargs)
    605 
    606     return ax

/Users/jespinoz/anaconda/lib/python3.5/site-packages/seaborn/distributions.py in _univariate_kdeplot(data, shade, vertical, kernel, bw, gridsize, cut, clip, legend, ax, cumulative, **kwargs)
    268         x, y = _statsmodels_univariate_kde(data, kernel, bw,
    269                                            gridsize, cut, clip,
--&gt; 270                                            cumulative=cumulative)
    271     else:
    272         # Fall back to scipy if missing statsmodels

/Users/jespinoz/anaconda/lib/python3.5/site-packages/seaborn/distributions.py in _statsmodels_univariate_kde(data, kernel, bw, gridsize, cut, clip, cumulative)
    326     fft = kernel == &quot;gau&quot;
    327     kde = smnp.KDEUnivariate(data)
--&gt; 328     kde.fit(kernel, bw, fft, gridsize=gridsize, cut=cut, clip=clip)
    329     if cumulative:
    330         grid, y = kde.support, kde.cdf

/Users/jespinoz/anaconda/lib/python3.5/site-packages/statsmodels/nonparametric/kde.py in fit(self, kernel, bw, fft, weights, gridsize, adjust, cut, clip)
    144             density, grid, bw = kdensityfft(endog, kernel=kernel, bw=bw,
    145                     adjust=adjust, weights=weights, gridsize=gridsize,
--&gt; 146                     clip=clip, cut=cut)
    147         else:
    148             density, grid, bw = kdensity(endog, kernel=kernel, bw=bw,

/Users/jespinoz/anaconda/lib/python3.5/site-packages/statsmodels/nonparametric/kde.py in kdensityfft(X, kernel, bw, weights, gridsize, adjust, clip, cut, retgrid)
    504     zstar = silverman_transform(bw, gridsize, RANGE)*y # 3.49 in Silverman
    505                                                    # 3.50 w Gaussian kernel
--&gt; 506     f = revrt(zstar)
    507     if retgrid:
    508         return f, grid, bw

/Users/jespinoz/anaconda/lib/python3.5/site-packages/statsmodels/nonparametric/kdetools.py in revrt(X, m)
     18     if m is None:
     19         m = len(X)
---&gt; 20     y = X[:m/2+1] + np.r_[0,X[m/2+1:],0]*1j
     21     return np.fft.irfft(y)*m
     22 

TypeError: slice indices must be integers or None or have an __index__ method"><pre class="notranslate"><code class="notranslate">---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-27-70aaa51b2d69&gt; in &lt;module&gt;()
      4 u = np.array([ 3.41959 , 1.79315 , 1.17229 , 1.59909 , 1.27337 , 1.21917 , 2.60591 , 2.0571 , 1.83865 , 1.94869 , 1.65421 , 1.67777 , 1.23781 , 1.46352 , 1.41791 , 2.00387 , 2.51076 , 1.59734 , 1.32982 , 1.89372 , 1.40614 , 1.41747 , 1.34109 , 1.38647 , 1.49432 , 1.05335 , 1.03805 , 1.18631 , 1.06402 , 1.06929 , 1.12031 , 1.07605 , 1.25702 , 1.25158 , 1.06541 , 1.07368 , 1.00559 , 1.00555 , 1.54561 , 1.01144 , 1.79598 , 1.02094 , 1.36236 , 1.6214 , 1.09803 , 1.25866 , 0.987888, 0.993576, 1.25805 , 5.67273 , 1.20665 , 0.985643, 1.07809 , 1.22087 , 1.1201 , 1.0367 , 1.26575 , 1.0295 , 0.993422, 1.08648 , 1.32767 , 1.35376 , 0.98585 , 0.991962, 1.49533 , 1.04997 , 0.995653, 1.13044 , 1.12311 , 1.29017 , 1.6424 , 1.1599 , 1.26453 , 1.0633 , 1.00454 , 1.35529 , 0.990889, 1.19621 , 1.30717 , 1.32321 , 1.5471 , 1.13225 , 1.97847 , 1.17142 , 1.36377 , 2.14062 , 0.996708, 1.03417 , 1.03212 , 1.0082 , 1.06432 , 3.49213 , 4.28245 , 1.00274 , 1.09338 , 1.0156 , 1.13566 , 1.10697 , 1.56438 , 0.96706 ], dtype=float)
      5 Se_u = pd.Series(u)
----&gt; 6 sns.kdeplot(Se_u)

/Users/jespinoz/anaconda/lib/python3.5/site-packages/seaborn/distributions.py in kdeplot(data, data2, shade, vertical, kernel, bw, gridsize, cut, clip, legend, cumulative, shade_lowest, ax, **kwargs)
    602         ax = _univariate_kdeplot(data, shade, vertical, kernel, bw,
    603                                  gridsize, cut, clip, legend, ax,
--&gt; 604                                  cumulative=cumulative, **kwargs)
    605 
    606     return ax

/Users/jespinoz/anaconda/lib/python3.5/site-packages/seaborn/distributions.py in _univariate_kdeplot(data, shade, vertical, kernel, bw, gridsize, cut, clip, legend, ax, cumulative, **kwargs)
    268         x, y = _statsmodels_univariate_kde(data, kernel, bw,
    269                                            gridsize, cut, clip,
--&gt; 270                                            cumulative=cumulative)
    271     else:
    272         # Fall back to scipy if missing statsmodels

/Users/jespinoz/anaconda/lib/python3.5/site-packages/seaborn/distributions.py in _statsmodels_univariate_kde(data, kernel, bw, gridsize, cut, clip, cumulative)
    326     fft = kernel == "gau"
    327     kde = smnp.KDEUnivariate(data)
--&gt; 328     kde.fit(kernel, bw, fft, gridsize=gridsize, cut=cut, clip=clip)
    329     if cumulative:
    330         grid, y = kde.support, kde.cdf

/Users/jespinoz/anaconda/lib/python3.5/site-packages/statsmodels/nonparametric/kde.py in fit(self, kernel, bw, fft, weights, gridsize, adjust, cut, clip)
    144             density, grid, bw = kdensityfft(endog, kernel=kernel, bw=bw,
    145                     adjust=adjust, weights=weights, gridsize=gridsize,
--&gt; 146                     clip=clip, cut=cut)
    147         else:
    148             density, grid, bw = kdensity(endog, kernel=kernel, bw=bw,

/Users/jespinoz/anaconda/lib/python3.5/site-packages/statsmodels/nonparametric/kde.py in kdensityfft(X, kernel, bw, weights, gridsize, adjust, clip, cut, retgrid)
    504     zstar = silverman_transform(bw, gridsize, RANGE)*y # 3.49 in Silverman
    505                                                    # 3.50 w Gaussian kernel
--&gt; 506     f = revrt(zstar)
    507     if retgrid:
    508         return f, grid, bw

/Users/jespinoz/anaconda/lib/python3.5/site-packages/statsmodels/nonparametric/kdetools.py in revrt(X, m)
     18     if m is None:
     19         m = len(X)
---&gt; 20     y = X[:m/2+1] + np.r_[0,X[m/2+1:],0]*1j
     21     return np.fft.irfft(y)*m
     22 

TypeError: slice indices must be integers or None or have an __index__ method
</code></pre></div>
<p dir="auto">but this works:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Se_u.plot(kind=&quot;kde&quot;)"><pre class="notranslate"><code class="notranslate">Se_u.plot(kind="kde")
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/9061708/22305748/9180bcec-e2f1-11e6-85b4-3a549d9dd765.png"><img src="https://cloud.githubusercontent.com/assets/9061708/22305748/9180bcec-e2f1-11e6-85b4-3a549d9dd765.png" alt="image" style="max-width: 100%;"></a></p>