Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.asmatrix

numpy.asmatrix(data,dtype=None)[source]

Interpret the input as a matrix.

Unlikematrix,asmatrix does not make a copy if the input is alreadya matrix or an ndarray. Equivalent tomatrix(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
>>>mmatrix([[5, 2],        [3, 4]])

Previous topic

numpy.matrix.view

Next topic

numpy.bmat

  • © Copyright 2008-2009, The Scipy community.
  • Last updated on Jun 10, 2017.
  • Created usingSphinx 1.5.3.

[8]ページ先頭

©2009-2025 Movatter.jp