<p dir="auto">Just as the empty sum is 0 and the empty product is 1, the empty norm should be 0 in my opinion.  In numpy, this convention has been implemented and is unit-tested for the default vector and matrix norms:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    def test_empty(self):
        assert_equal(norm([]), 0.0)
        assert_equal(norm(array([], dtype=self.dt)), 0.0)
        assert_equal(norm(atleast_2d(array([], dtype=self.dt))), 0.0)"><pre class="notranslate">    <span class="pl-k">def</span> <span class="pl-en">test_empty</span>(<span class="pl-s1">self</span>):
        <span class="pl-en">assert_equal</span>(<span class="pl-en">norm</span>([]), <span class="pl-c1">0.0</span>)
        <span class="pl-en">assert_equal</span>(<span class="pl-en">norm</span>(<span class="pl-en">array</span>([], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">dt</span>)), <span class="pl-c1">0.0</span>)
        <span class="pl-en">assert_equal</span>(<span class="pl-en">norm</span>(<span class="pl-en">atleast_2d</span>(<span class="pl-en">array</span>([], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">dt</span>))), <span class="pl-c1">0.0</span>)</pre></div>
<p dir="auto">Some of the non-default empty norms raise exceptions.  The induced matrix 2-norm raises exceptions for two reasons -- first, attempting to compute the singular values of a size-0 matrix raises an exception, and second, even if the the empty array of singular values were to be returned, attempting to compute the max of an empty sequence also raises an exception.  The empty induced matrix 1-norm and np.inf-norm each also raise an exception because they try to compute an empty max.</p>
<p dir="auto">It may sound silly but it may be of interest to be able to compute the norm of [] so that one has not to catch this case before (would make my code more readable).</p>
<p dir="auto">At the moment numpy.linalg.norm(numpy.array([]),ord=):</p>
<ul dir="auto">
<li>works with ord = 0,1,2,... giving the result 0. Although here is a incosistency returning np.int in the case of ord = 0 and np.float in the others.</li>
<li>works not not with ord = numpy.inf since this computes abs(x).max() without checking if x is nonempty.</li>
</ul>
<p dir="auto">It would be very nice, if in the [] case also for ord = inf one would return 0, which would be consistent with matlab behaviour.</p>