<p dir="auto"><a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.rv_discrete.html" rel="nofollow"><code class="notranslate">scipy.stats.rv_discrete</code></a> requires that the <code class="notranslate">x</code> input for the <code class="notranslate">values</code> parameters are integers:</p>
<blockquote>
<p dir="auto">values : tuple of two array_like, optional<br>
(xk, pk) <strong>where xk are integers</strong> and pk are the non-zero probabilities between 0 and 1 with sum(pk) = 1. xk and pk must have the same shape.</p>
</blockquote>
<h4 dir="auto">Reproducing code example:</h4>

<p dir="auto">The example code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from scipy import stats
xk = np.arange(7)
pk = (0.1, 0.2, 0.3, 0.1, 0.1, 0.0, 0.2)
custm = stats.rv_discrete(name='custm', values=(xk, pk))

import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
ax.plot(xk, custm.pmf(xk), 'ro', ms=12, mec='r')
ax.vlines(xk, 0, custm.pmf(xk), colors='r', lw=4)
plt.show()"><pre class="notranslate"><code class="notranslate">from scipy import stats
xk = np.arange(7)
pk = (0.1, 0.2, 0.3, 0.1, 0.1, 0.0, 0.2)
custm = stats.rv_discrete(name='custm', values=(xk, pk))

import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
ax.plot(xk, custm.pmf(xk), 'ro', ms=12, mec='r')
ax.vlines(xk, 0, custm.pmf(xk), colors='r', lw=4)
plt.show()
</code></pre></div>
<p dir="auto">returns</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/a3f028bf6c346ea07d2ad5c1724654a3e568e3a4ccbab7d40cbb25dca3974037/68747470733a2f2f646f63732e73636970792e6f72672f646f632f73636970792f5f696d616765732f73636970792d73746174732d72765f64697363726574652d315f30305f30302e706e67"><img src="https://camo.githubusercontent.com/a3f028bf6c346ea07d2ad5c1724654a3e568e3a4ccbab7d40cbb25dca3974037/68747470733a2f2f646f63732e73636970792e6f72672f646f632f73636970792f5f696d616765732f73636970792d73746174732d72765f64697363726574652d315f30305f30302e706e67" alt="" data-canonical-src="https://docs.scipy.org/doc/scipy/_images/scipy-stats-rv_discrete-1_00_00.png" style="max-width: 100%;"></a></p>
<p dir="auto">but if I change to <code class="notranslate">xk = np.linspace(1., 6.9, 7)</code> I get:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6054951/109506871-e61b1500-7a7c-11eb-9eae-7279f56399f5.png"><img src="https://user-images.githubusercontent.com/6054951/109506871-e61b1500-7a7c-11eb-9eae-7279f56399f5.png" alt="Captura de pantalla de 2021-03-01 10-52-59" style="max-width: 100%;"></a></p>
<p dir="auto">This is a user error with a silent fail. There should be a validation or at least a warning shown.</p>
<h4 dir="auto">Scipy/Numpy/Python version information:</h4>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1.6.1 1.19.2 sys.version_info(major=3, minor=8, micro=8, releaselevel='final', serial=0)"><pre class="notranslate"><code class="notranslate">1.6.1 1.19.2 sys.version_info(major=3, minor=8, micro=8, releaselevel='final', serial=0)
</code></pre></div>
<p dir="auto"><code class="notranslate">TestHausdorff.test_symmetry</code> and a number of other <code class="notranslate">directed_hausdorff</code> tests triggered the check for unknown objects we just put into <code class="notranslate">RandomState.shuffle</code> (see <a href="https://github.com/scipy/scipy/pull/13463/checks?check_run_id=1799089671">here</a>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mtrand.pyx:4478: in numpy.random.mtrand.RandomState.shuffle
    ???
E   UserWarning: `x` isn't a recognized object; `shuffle` is not guaranteed to behave correctly.
E.g., non-numpy array/tensor objects with view semantics may contain duplicates after shuffling."><pre class="notranslate"><code class="notranslate">mtrand.pyx:4478: in numpy.random.mtrand.RandomState.shuffle
    ???
E   UserWarning: `x` isn't a recognized object; `shuffle` is not guaranteed to behave correctly.
E.g., non-numpy array/tensor objects with view semantics may contain duplicates after shuffling.
</code></pre></div>