OwlCyberSecurity - MANAGER
Edit File: defmatrix.cpython-38.pyc
U �p�]�w � @ s� d dl mZmZmZ ddddgZd dlZd dlZd dlZd dlm m Z d dlmZm Z d dlmZ d d lmZ d d� Zed�dd d��Zed�G dd� dej��Zdd� Zed�ddd��ZeZdS )� )�division�absolute_import�print_function�matrix�bmat�mat�asmatrixN)�concatenate�isscalar)� set_module��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�astZliteral_eval�len� ValueError�append)�data�char�rows�newdata�count�row�trow�newrow�colZtempZNcols� r# �;/usr/lib/python3/dist-packages/numpy/matrixlib/defmatrix.py�_convert_from_string s$ r% Znumpyc 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'