[NumPy-Tickets] [NumPy] #1556: numpy.linalg.det does not handle scalars or 1d array scalars
NumPy Trac
numpy-tickets@scipy....
Mon Jul 26 11:42:45 CDT 2010
#1556: numpy.linalg.det does not handle scalars or 1d array scalars
---------------------------------+------------------------------------------
Reporter: jseabold | Owner: pv
Type: enhancement | Status: new
Priority: normal | Milestone: 2.0.0
Component: numpy.linalg | Version: devel
Keywords: determinant, linalg |
---------------------------------+------------------------------------------
Current behavior
{{{
In [20]: np.linalg.det([[1]])
Out[20]: 1.0
}}}
but
{{{
In [21]: np.linalg.det([1])
<snip>
LinAlgError: 1-dimensional array given. Array must be two-
dimensional
}}}
After applying the attached diff
{{{
In [3]: np.linalg.det([[1]])
Out[3]: 1.0
In [4]: np.linalg.det([1])
Out[4]: 1.0
In [5]: np.linalg.det(1)
Out[5]: 1.0
}}}
It seems to me that checking if an array is 2d then checking if it's
square is redundant.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1556>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list