MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / empty

Function empty

site-packages/numpy/matlib.py:13–49  ·  view source on GitHub ↗

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')

Source from the content-addressed store, hash-verified

11__all__ += ['rand', 'randn', 'repmat']
12
13def 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
51def ones(shape, dtype=None, order='C'):
52 """

Callers 15

identityFunction · 0.70
insert_uniqueMethod · 0.50
push_backMethod · 0.50
onesFunction · 0.50
fullFunction · 0.50
crossFunction · 0.50
indicesFunction · 0.50
vanderFunction · 0.50
deleteFunction · 0.50
insertFunction · 0.50
qrFunction · 0.50
pinvFunction · 0.50

Calls 1

__new__Method · 0.45

Tested by

no test coverage detected