<h3 dir="auto">Reproducing code example:</h3>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
import matplotlib.pyplot as plt

n_groups = 4
means_frank = (90, 55, 40, 65)
means_guido = (85, 62, 54, 20)

fig, ax = plt.subplots()
index = np.arange(n_groups)
bar_width = 0.35
opacity = 0.8

rects1 = plt.bar(index, means_frank, bar_width,
alpha=opacity,
color='b',
label='Frank')

rects2 = plt.bar(index + bar_width, means_guido, bar_width,
alpha=opacity,
color='g',
label='Guido')

plt.xlabel('Person')
plt.ylabel('Scores')
plt.title('Scores by person')
plt.xticks(index + bar_width, ('A', 'B', 'C', 'D'))
plt.legend()

plt.tight_layout()
plt.show()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>

<span class="pl-s1">n_groups</span> <span class="pl-c1">=</span> <span class="pl-c1">4</span>
<span class="pl-s1">means_frank</span> <span class="pl-c1">=</span> (<span class="pl-c1">90</span>, <span class="pl-c1">55</span>, <span class="pl-c1">40</span>, <span class="pl-c1">65</span>)
<span class="pl-s1">means_guido</span> <span class="pl-c1">=</span> (<span class="pl-c1">85</span>, <span class="pl-c1">62</span>, <span class="pl-c1">54</span>, <span class="pl-c1">20</span>)

<span class="pl-s1">fig</span>, <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">subplots</span>()
<span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-s1">n_groups</span>)
<span class="pl-s1">bar_width</span> <span class="pl-c1">=</span> <span class="pl-c1">0.35</span>
<span class="pl-s1">opacity</span> <span class="pl-c1">=</span> <span class="pl-c1">0.8</span>

<span class="pl-s1">rects1</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">bar</span>(<span class="pl-s1">index</span>, <span class="pl-s1">means_frank</span>, <span class="pl-s1">bar_width</span>,
<span class="pl-s1">alpha</span><span class="pl-c1">=</span><span class="pl-s1">opacity</span>,
<span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s">'b'</span>,
<span class="pl-s1">label</span><span class="pl-c1">=</span><span class="pl-s">'Frank'</span>)

<span class="pl-s1">rects2</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">bar</span>(<span class="pl-s1">index</span> <span class="pl-c1">+</span> <span class="pl-s1">bar_width</span>, <span class="pl-s1">means_guido</span>, <span class="pl-s1">bar_width</span>,
<span class="pl-s1">alpha</span><span class="pl-c1">=</span><span class="pl-s1">opacity</span>,
<span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s">'g'</span>,
<span class="pl-s1">label</span><span class="pl-c1">=</span><span class="pl-s">'Guido'</span>)

<span class="pl-s1">plt</span>.<span class="pl-en">xlabel</span>(<span class="pl-s">'Person'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">ylabel</span>(<span class="pl-s">'Scores'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">title</span>(<span class="pl-s">'Scores by person'</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">xticks</span>(<span class="pl-s1">index</span> <span class="pl-c1">+</span> <span class="pl-s1">bar_width</span>, (<span class="pl-s">'A'</span>, <span class="pl-s">'B'</span>, <span class="pl-s">'C'</span>, <span class="pl-s">'D'</span>))
<span class="pl-s1">plt</span>.<span class="pl-en">legend</span>()

<span class="pl-s1">plt</span>.<span class="pl-en">tight_layout</span>()
<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<h3 dir="auto">Error message:</h3>

<p dir="auto"><code class="notranslate">RuntimeError: The current Numpy installation ('C:\\Users\\Username\\AppData\\Local\\Programs\\Python\\Python39\\Lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime.</code></p>

<h3 dir="auto">NumPy/Python version information:</h3>

<p dir="auto">Python version : python3.9<br>
NumPy version : numpy1.19.4</p>
<h1 dir="auto">This is a BUG</h1>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="train = np.zeros([26,26])
train2 = np.zeros([26,26])
tmp = [1,2,3,4,5,6,1,2,3,4,5,6]
train[tmp[0:-1], tmp[1:]] += 1
for i in range(len(tmp)-1):
    train2[tmp[i], tmp[i+1]] += 1
print(np.sum(train - train2))"><pre class="notranslate"><span class="pl-s1">train</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">zeros</span>([<span class="pl-c1">26</span>,<span class="pl-c1">26</span>])
<span class="pl-s1">train2</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">zeros</span>([<span class="pl-c1">26</span>,<span class="pl-c1">26</span>])
<span class="pl-s1">tmp</span> <span class="pl-c1">=</span> [<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>,<span class="pl-c1">4</span>,<span class="pl-c1">5</span>,<span class="pl-c1">6</span>,<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>,<span class="pl-c1">4</span>,<span class="pl-c1">5</span>,<span class="pl-c1">6</span>]
<span class="pl-s1">train</span>[<span class="pl-s1">tmp</span>[<span class="pl-c1">0</span>:<span class="pl-c1">-</span><span class="pl-c1">1</span>], <span class="pl-s1">tmp</span>[<span class="pl-c1">1</span>:]] <span class="pl-c1">+=</span> <span class="pl-c1">1</span>
<span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-en">len</span>(<span class="pl-s1">tmp</span>)<span class="pl-c1">-</span><span class="pl-c1">1</span>):
    <span class="pl-s1">train2</span>[<span class="pl-s1">tmp</span>[<span class="pl-s1">i</span>], <span class="pl-s1">tmp</span>[<span class="pl-s1">i</span><span class="pl-c1">+</span><span class="pl-c1">1</span>]] <span class="pl-c1">+=</span> <span class="pl-c1">1</span>
<span class="pl-en">print</span>(<span class="pl-s1">np</span>.<span class="pl-en">sum</span>(<span class="pl-s1">train</span> <span class="pl-c1">-</span> <span class="pl-s1">train2</span>))</pre></div>
<p dir="auto"><strong>the output is -5</strong><br>
I find that <code class="notranslate">train</code> is not equal to <code class="notranslate">train2</code> when there are some duplicate tuples in <code class="notranslate">tmp</code>. Is there something wrong in numpy slicing.</p>