Return a new matrix of given shape and type, without initializing entries. Parameters ---------- shape : int or tuple of int Shape of the empty matrix. dtype : data-type, optional Desired output data-type. order : {'C', 'F'}, optional Whether to store mul
(shape, dtype=None, order='C')
| 11 | __all__ += ['rand', 'randn', 'repmat'] |
| 12 | |
| 13 | def empty(shape, dtype=None, order='C'): |
| 14 | """Return a new matrix of given shape and type, without initializing entries. |
| 15 | |
| 16 | Parameters |
| 17 | ---------- |
| 18 | shape : int or tuple of int |
| 19 | Shape of the empty matrix. |
| 20 | dtype : data-type, optional |
| 21 | Desired output data-type. |
| 22 | order : {'C', 'F'}, optional |
| 23 | Whether to store multi-dimensional data in row-major |
| 24 | (C-style) or column-major (Fortran-style) order in |
| 25 | memory. |
| 26 | |
| 27 | See Also |
| 28 | -------- |
| 29 | empty_like, zeros |
| 30 | |
| 31 | Notes |
| 32 | ----- |
| 33 | `empty`, unlike `zeros`, does not set the matrix values to zero, |
| 34 | and may therefore be marginally faster. On the other hand, it requires |
| 35 | the user to manually set all the values in the array, and should be |
| 36 | used with caution. |
| 37 | |
| 38 | Examples |
| 39 | -------- |
| 40 | >>> import numpy.matlib |
| 41 | >>> np.matlib.empty((2, 2)) # filled with random data |
| 42 | matrix([[ 6.76425276e-320, 9.79033856e-307], |
| 43 | [ 7.39337286e-309, 3.22135945e-309]]) #random |
| 44 | >>> np.matlib.empty((2, 2), dtype=int) |
| 45 | matrix([[ 6600475, 0], |
| 46 | [ 6586976, 22740995]]) #random |
| 47 | |
| 48 | """ |
| 49 | return ndarray.__new__(matrix, shape, dtype, order=order) |
| 50 | |
| 51 | def ones(shape, dtype=None, order='C'): |
| 52 | """ |
no test coverage detected