Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/numpy/matrixlib/__pycache__/defmatrix.cpython-39.pyc
Ðазад
a e�h�w � @ s� g d �Z ddlZddlZddlZddlmZ ddlm mZ ddlm Z mZ ddlm Z dd� Zed �dd d��Zed �G dd � d e j��Zdd� Zed �ddd��ZeZdS ))�matrix�bmat�mat�asmatrix� N� )� set_module)�concatenate�isscalar��matrix_powerc C s� dD ]}| � |d�} q| �d�}g }d}|D ]n}|�d�}g }|D ]}|�� } |�ttj| �� qB|dkrtt|�} nt|�| kr�td��|d7 }|�|� q,|S )Nz[]� �;r �,zRows not the same size.� ) �replace�split�extend�map�ast�literal_eval�len� ValueError�append)�data�char�rows�newdata�count�row�trow�newrow�col�tempZNcols� r# ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/numpy/matrixlib/defmatrix.py�_convert_from_string s$ r% �numpyc C s t | |dd�S )a@ Interpret the input as a matrix. Unlike `matrix`, `asmatrix` does not make a copy if the input is already a matrix or an ndarray. Equivalent to ``matrix(data, copy=False)``. Parameters ---------- data : array_like Input data. dtype : data-type Data-type of the output matrix. Returns ------- mat : matrix `data` interpreted as a matrix. Examples -------- >>> x = np.array([[1, 2], [3, 4]]) >>> m = np.asmatrix(x) >>> x[0,0] = 5 >>> m matrix([[5, 2], [3, 4]]) F��dtype�copy)r )r r( r# r# r$ r % s !r c @ sf e Zd ZdZdZdGdd�Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� ZdHdd�ZdIdd �ZdJd"d#�ZdKd$d%�ZdLd'd(�ZdMd)d*�ZdNd+d,�ZdOd-d.�ZdPd/d0�ZdQd1d2�ZdRd3d4�ZdSd5d6�ZdTd7d8�ZdUd9d:�Zed;d<� �Z ed=d>� �Z!ed?d@� �Z"dVdAdB�Z#edCdD� �Z$edEdF� �Z%e$j&Z'e!j&Z(e"j&Z)e%j&Z*e j&Z+dS )Wr a� matrix(data, dtype=None, copy=True) .. note:: It is no longer recommended to use this class, even for linear algebra. Instead use regular arrays. The class may be removed in the future. Returns a matrix from an array-like object, or from a string of data. A matrix is a specialized 2-D array that retains its 2-D nature through operations. It has certain special operators, such as ``*`` (matrix multiplication) and ``**`` (matrix power). Parameters ---------- data : array_like or string If `data` is a string, it is interpreted as a matrix with commas or spaces separating columns, and semicolons separating rows. dtype : data-type Data-type of the output matrix. copy : bool If `data` is already an `ndarray`, then this flag determines whether the data is copied (the default), or whether a view is constructed. See Also -------- array Examples -------- >>> a = np.matrix('1 2; 3 4') >>> a matrix([[1, 2], [3, 4]]) >>> np.matrix([[1, 2], [3, 4]]) matrix([[1, 2], [3, 4]]) g $@NTc C sL t jdtdd� t|t�rF|j}|d u r,|}||kr<|s<|S |�|�S t|tj�r�|d u rb|j}n t�|�}|� | �}||jkr�|�|�S |r�|� � S |S t|t�r�t|�}tj |||d�}|j}|j} |dkr�td��n"|dkr�d} n|dkr�d| d f} d } |dk�r|jj�rd } | �s0|jj�s0|� � }tjj| | |j|| d�}|S )Nz�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.r )� stacklevelr'