Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
matlib.cpython-313.pyc320 linesDownload Raw Back to __pycache__
1�

2z�j3+����SSKr\R"S\SS9 SSKrSSK7 SSKJrJr \Rr/SQr	\	\R-
r	SS	jr4SS5jrSSjrSSjr
SS\S4S
jrSrSrSrg)�NaImporting from numpy.matlib is deprecated since 1.19.0. The matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray. �)�6stacklevel)�*)�asmatrix�matrix)�rand�randn�repmat�Cc�4�[R[XUS9$)a�Return a new matrix of given shape and type, without initializing entries.7 8Parameters9----------10shape : int or tuple of int11    Shape of the empty matrix.12dtype : data-type, optional13    Desired output data-type.14order : {'C', 'F'}, optional15    Whether to store multi-dimensional data in row-major16    (C-style) or column-major (Fortran-style) order in17    memory.18 19See Also20--------21numpy.empty : Equivalent array function.22matlib.zeros : Return a matrix of zeros.23matlib.ones : Return a matrix of ones.24 25Notes26-----27Unlike other matrix creation functions (e.g. `matlib.zeros`,28`matlib.ones`), `matlib.empty` does not initialize the values of the29matrix, and may therefore be marginally faster. However, the values30stored in the newly allocated matrix are arbitrary. For reproducible31behavior, be sure to set each element of the matrix before reading.32 33Examples34--------35>>> import numpy.matlib36>>> np.matlib.empty((2, 2))    # filled with random data37matrix([[  6.76425276e-320,   9.79033856e-307], # random38        [  7.39337286e-309,   3.22135945e-309]])39>>> np.matlib.empty((2, 2), dtype=int)40matrix([[ 6600475,        0], # random41        [ 6586976, 22740995]])42 43��order)�ndarray�__new__r)�shape�dtypers   �RD:\code\apps\devtools\python\user_packages\Python313\site-packages\numpy/matlib.py�emptyrs��N�?�?�6�5�u�?�=�=�c�Z�[R[XUS9nURS5 U$)a
44Matrix of ones.45 46Return a matrix of given shape and type, filled with ones.47 48Parameters49----------50shape : {sequence of ints, int}51    Shape of the matrix52dtype : data-type, optional53    The desired data-type for the matrix, default is np.float64.54order : {'C', 'F'}, optional55    Whether to store matrix in C- or Fortran-contiguous order,56    default is 'C'.57 58Returns59-------60out : matrix61    Matrix of ones of given shape, dtype, and order.62 63See Also64--------65ones : Array of ones.66matlib.zeros : Zero matrix.67 68Notes69-----70If `shape` has length one i.e. ``(N,)``, or is a scalar ``N``,71`out` becomes a single row matrix of shape ``(1,N)``.72 73Examples74--------75>>> np.matlib.ones((2,3))76matrix([[1.,  1.,  1.],77        [1.,  1.,  1.]])78 79>>> np.matlib.ones(2)80matrix([[1.,  1.]])81 82r
��rrr�fill�rrr�as    r�onesrBs)��R	�����E��:�A��F�F�1�I��Hrc�Z�[R[XUS9nURS5 U$)a283Return a matrix of given shape and type, filled with zeros.84 85Parameters86----------87shape : int or sequence of ints88    Shape of the matrix89dtype : data-type, optional90    The desired data-type for the matrix, default is float.91order : {'C', 'F'}, optional92    Whether to store the result in C- or Fortran-contiguous order,93    default is 'C'.94 95Returns96-------97out : matrix98    Zero matrix of given shape, dtype, and order.99 100See Also101--------102numpy.zeros : Equivalent array function.103matlib.ones : Return a matrix of ones.104 105Notes106-----107If `shape` has length one i.e. ``(N,)``, or is a scalar ``N``,108`out` becomes a single row matrix of shape ``(1,N)``.109 110Examples111--------112>>> import numpy.matlib113>>> np.matlib.zeros((2, 3))114matrix([[0.,  0.,  0.],115        [0.,  0.,  0.]])116 117>>> np.matlib.zeros(2)118matrix([[0.,  0.]])119 120r
rrrs    r�zerosros)��P	�����E��:�A��F�F�1�I��Hrc�L�[S/US/--US9n[X4US9nX#lU$)aA121Returns the square identity matrix of given size.122 123Parameters124----------125n : int126    Size of the returned identity matrix.127dtype : data-type, optional128    Data-type of the output. Defaults to ``float``.129 130Returns131-------132out : matrix133    `n` x `n` matrix with its main diagonal set to one,134    and all other elements zero.135 136See Also137--------138numpy.identity : Equivalent array function.139matlib.eye : More general matrix identity function.140 141Examples142--------143>>> import numpy.matlib144>>> np.matlib.identity(3, dtype=int)145matrix([[1, 0, 0],146        [0, 1, 0],147        [0, 0, 1]])148 149rr)r)�arrayr�flat)�nrr�bs    r�identityr$�s4��>	�q�c�A���G�m�5�)�A�
�q�f�E�"�A�
�F��Hrc150�@�[[R"XX#US95$)a�151Return a matrix with ones on the diagonal and zeros elsewhere.152 153Parameters154----------155n : int156    Number of rows in the output.157M : int, optional158    Number of columns in the output, defaults to `n`.159k : int, optional160    Index of the diagonal: 0 refers to the main diagonal,161    a positive value refers to an upper diagonal,162    and a negative value to a lower diagonal.163dtype : dtype, optional164    Data-type of the returned matrix.165order : {'C', 'F'}, optional166    Whether the output should be stored in row-major (C-style) or167    column-major (Fortran-style) order in memory.168 169Returns170-------171I : matrix172    A `n` x `M` matrix where all elements are equal to zero,173    except for the `k`-th diagonal, whose values are equal to one.174 175See Also176--------177numpy.eye : Equivalent array function.178identity : Square identity matrix.179 180Examples181--------182>>> import numpy.matlib183>>> np.matlib.eye(3, k=1, dtype=float)184matrix([[0.,  1.,  0.],185        [0.,  0.,  1.],186        [0.,  0.,  0.]])187 188)�M�krr)r�np�eye)r"r&r'rrs     rr)r)�s��P�B�F�F�1�Q�5�A�B�Brc��[US[5(aUSn[[RR189"U65$)a190Return a matrix of random values with given shape.191 192Create a matrix of the given shape and propagate it with193random samples from a uniform distribution over ``[0, 1)``.194 195Parameters196----------197\*args : Arguments198    Shape of the output.199    If given as N integers, each integer specifies the size of one200    dimension.201    If given as a tuple, this tuple gives the complete shape.202 203Returns204-------205out : ndarray206    The matrix of random values with shape given by `\*args`.207 208See Also209--------210randn, numpy.random.RandomState.rand211 212Examples213--------214>>> np.random.seed(123)215>>> import numpy.matlib216>>> np.matlib.rand(2, 3)217matrix([[0.69646919, 0.28613933, 0.22685145],218        [0.55131477, 0.71946897, 0.42310646]])219>>> np.matlib.rand((2, 3))220matrix([[0.9807642 , 0.68482974, 0.4809319 ],221        [0.39211752, 0.34317802, 0.72904971]])222 223If the first argument is a tuple, other arguments are ignored:224 225>>> np.matlib.rand((2, 3), 4)226matrix([[0.43857224, 0.0596779 , 0.39804426],227        [0.73799541, 0.18249173, 0.17545176]])228 229r)�230isinstance�tuplerr(�randomr��argss rrr�s7��T�$�q�'�5�!�!��A�w���B�I�I�N�N�D�)�*�*rc��[US[5(aUSn[[RR231"U65$)a�232Return a random matrix with data from the "standard normal" distribution.233 234`randn` generates a matrix filled with random floats sampled from a235univariate "normal" (Gaussian) distribution of mean 0 and variance 1.236 237Parameters238----------239\*args : Arguments240    Shape of the output.241    If given as N integers, each integer specifies the size of one242    dimension. If given as a tuple, this tuple gives the complete shape.243 244Returns245-------246Z : matrix of floats247    A matrix of floating-point samples drawn from the standard normal248    distribution.249 250See Also251--------252rand, numpy.random.RandomState.randn253 254Notes255-----256For random samples from the normal distribution with mean ``mu`` and257standard deviation ``sigma``, use::258 259    sigma * np.matlib.randn(...) + mu260 261Examples262--------263>>> np.random.seed(123)264>>> import numpy.matlib265>>> np.matlib.randn(1)266matrix([[-1.0856306]])267>>> np.matlib.randn(1, 2, 3)268matrix([[ 0.99734545,  0.2829785 , -1.50629471],269        [-0.57860025,  1.65143654, -2.42667924]])270 271Two-by-four matrix of samples from the normal distribution with272mean 3 and standard deviation 2.5:273 274>>> 2.5 * np.matlib.randn((2, 4)) + 3275matrix([[1.92771843, 6.16484065, 0.83314899, 1.30278462],276        [2.76322758, 6.72847407, 1.40274501, 1.8900451 ]])277 278r)r+r,rr(r-r	r.s rr	r	s7��b�$�q�'�5�!�!��A�w���B�I�I�O�O�T�*�+�+rc�X�[U5nURnUS:XaSupEO%US:XaSURSpTOURupEXA-nXR-nURSUR5RUS5RXe5RUS5nURXg5$)a�279Repeat a 0-D to 2-D array or matrix MxN times.280 281Parameters282----------283a : array_like284    The array or matrix to be repeated.285m, n : int286    The number of times `a` is repeated along the first and second axes.287 288Returns289-------290out : ndarray291    The result of repeating `a`.292 293Examples294--------295>>> import numpy.matlib296>>> a0 = np.array(1)297>>> np.matlib.repmat(a0, 2, 3)298array([[1, 1, 1],299       [1, 1, 1]])300 301>>> a1 = np.arange(4)302>>> np.matlib.repmat(a1, 2, 2)303array([[0, 1, 2, 3, 0, 1, 2, 3],304       [0, 1, 2, 3, 0, 1, 2, 3]])305 306>>> a2 = np.asmatrix(np.arange(6).reshape(2, 3))307>>> np.matlib.repmat(a2, 2, 3)308matrix([[0, 1, 2, 0, 1, 2, 0, 1, 2],309        [3, 4, 5, 3, 4, 5, 3, 4, 5],310        [0, 1, 2, 0, 1, 2, 0, 1, 2],311        [3, 4, 5, 3, 4, 5, 3, 4, 5]])312 313r)rrr)�314asanyarray�ndimr�reshape�size�repeat)	r�mr"r3�origrows�origcols�rows�cols�cs	         rr315r316Ls���J	�1�
�A��6�6�D��q�y�#���(�	
���������(��W�W����<�D��<�D�	�	�	�!�Q�V�V��#�#�A�q�)�1�1�$�A�H�H��A�N�A��9�9�T� � r)Nr)N)�warnings�warn�PendingDeprecationWarning�numpyr(�numpy.matrixlib.defmatrixrr�__version__�__all__rrrr$�floatr)rr	r317�rr�<module>rFs����	�
�
�A�318(�A�7��319�6��n�n��320%���2�:�:���'>�R+
�Z*
�X"
�H�Q�e�3�(C�T,+�\3,�j0!r
codekingpro/portable-devtools · Team Ai