<p dir="auto">This strange behavior came up in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="298979437" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/19813" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/19813/hovercard" href="https://github.com/pandas-dev/pandas/issues/19813">pandas-dev/pandas#19813</a>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [23]: np.array([], dtype=object).sum()
Out[23]: False

In [26]: np.array([], dtype=object).prod()
Out[26]: True"><pre class="notranslate"><code class="notranslate">In [23]: np.array([], dtype=object).sum()
Out[23]: False

In [26]: np.array([], dtype=object).prod()
Out[26]: True
</code></pre></div>
<p dir="auto">It's almost as if NumPy picks a dtype at random (e.g., bool in this case) to use for computing the result. A more obviously and likely more consistent choice would be to use the identities for the appropriate ufuncs (i.e., <code class="notranslate">np.add.identity</code> and <code class="notranslate">np.mul.identity</code>), which are the integers <code class="notranslate">0</code> and <code class="notranslate">1</code>, respectively.</p>
<p dir="auto">This is pretty weird:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; arr = np.array([1, 2, 3], dtype=object)
&gt;&gt;&gt; np.add.reduce(arr)
6
&gt;&gt;&gt; np.add.reduce(arr[:0])
False
&gt;&gt;&gt; np.multiply.reduce(arr)
6
&gt;&gt;&gt; np.multiply.reduce(arr[:0])
True"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">arr</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">object</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">np</span>.<span class="pl-s1">add</span>.<span class="pl-en">reduce</span>(<span class="pl-s1">arr</span>)
<span class="pl-c1">6</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">np</span>.<span class="pl-s1">add</span>.<span class="pl-en">reduce</span>(<span class="pl-s1">arr</span>[:<span class="pl-c1">0</span>])
<span class="pl-c1">False</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">np</span>.<span class="pl-s1">multiply</span>.<span class="pl-en">reduce</span>(<span class="pl-s1">arr</span>)
<span class="pl-c1">6</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">np</span>.<span class="pl-s1">multiply</span>.<span class="pl-en">reduce</span>(<span class="pl-s1">arr</span>[:<span class="pl-c1">0</span>])
<span class="pl-c1">True</span></pre></div>
<p dir="auto">It happens for array results too:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; arr = np.array([[1], [2], [3]], dtype=object)
&gt;&gt;&gt; np.add.reduce(arr[:0], axis=0)
array([False], dtype=object)
&gt;&gt;&gt; np.multiply.reduce(arr[:0], axis=0)
array([True], dtype=object) "><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">arr</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([[<span class="pl-c1">1</span>], [<span class="pl-c1">2</span>], [<span class="pl-c1">3</span>]], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">object</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">np</span>.<span class="pl-s1">add</span>.<span class="pl-en">reduce</span>(<span class="pl-s1">arr</span>[:<span class="pl-c1">0</span>], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>)
<span class="pl-en">array</span>([<span class="pl-c1">False</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">object</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">np</span>.<span class="pl-s1">multiply</span>.<span class="pl-en">reduce</span>(<span class="pl-s1">arr</span>[:<span class="pl-c1">0</span>], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>)
<span class="pl-en">array</span>([<span class="pl-c1">True</span>], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">object</span>) </pre></div>