diff options
Diffstat (limited to 'numpy/matlib.py')
-rw-r--r-- | numpy/matlib.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/numpy/matlib.py b/numpy/matlib.py index 656ca3458..004e5f0c8 100644 --- a/numpy/matlib.py +++ b/numpy/matlib.py @@ -173,7 +173,7 @@ def identity(n,dtype=None): b.flat = a return b -def eye(n,M=None, k=0, dtype=float): +def eye(n,M=None, k=0, dtype=float, order='C'): """ Return a matrix with ones on the diagonal and zeros elsewhere. @@ -189,6 +189,11 @@ def eye(n,M=None, k=0, dtype=float): and a negative value to a lower diagonal. dtype : dtype, optional Data-type of the returned matrix. + order : {'C', 'F'}, optional + Whether the output should be stored in row-major (C-style) or + column-major (Fortran-style) order in memory. + + .. versionadded:: 1.14.0 Returns ------- @@ -210,7 +215,7 @@ def eye(n,M=None, k=0, dtype=float): [ 0., 0., 0.]]) """ - return asmatrix(np.eye(n, M, k, dtype)) + return asmatrix(np.eye(n, M=M, k=k, dtype=dtype, order=order)) def rand(*args): """ |