[SciPy-dev] Fancy indexing curiosity
Alan G Isaac
aisaac at american.edu
Mon Jan 9 07:55:09 CST 2006
> On Mon, 9 Jan 2006, Arnd Baecker wrote:
>> In : import numpy
>> In : a1=numpy.array(, dtype=numpy.complex128)
>> In : a2=numpy.array(, dtype=numpy.complex128)
>> In : numpy.dot(a1,a2)
>> Out: (2.6815615888703731e+154+2.6815615859888243e+154j)
On Mon, 9 Jan 2006, (CST) Pearu Peterson apparently wrote:
> I have commited a patch to numpy svn so that
> numpy.core.multiarray.dot(,) -> 0
> Note that currently
> numpy.core.multiarray.dot(,2) -> 
> for instance. Is this desired behaviour?
Is there is a hurry to fix this situation without a clear
statement of the underlying principle? Maybe I just
overlook the principle?
This seems right:
numpy.core.multiarray.dot(,2) -> 
It is a natural corner case for a scalar product, which
'dot' already supports. The principle is that scalar
multiplication returns the array of the same dimensions
containing scalar multiple of each element of the original array.
This seems quite wrong:
numpy.core.multiarray.dot(,) -> 0
I expect an exception.
Otherwise two empty arrays are judged orthogonal,
which seems extremely odd.
(Not as odd as the previous behavior, of course.)
If returning 0 is the right thing to do,
what is the reason for this being right?
More information about the Scipy-dev