Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Module « numpy »

Classe « matrix »

Informations générales

Héritage

builtins.object
    ndarray
        matrix

Définition

class matrix(ndarray):

Description [extrait de matrix.__doc__]

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

    

Constructeur(s)

Signature du constructeur Description
__new__(subtype, data, dtype=None, copy=True)

Liste des attributs statiques

Attributs statiques hérités de la classe ndarray

base, ctypes, data, dtype, flags, flat, imag, itemsize, nbytes, ndim, real, shape, size, strides, T

Liste des propriétés

Nom de la propriétéDescription
A
A1
H
I
T

Liste des opérateurs

Signature de l'opérateur Description
__getitem__(self, index)
__imul__(self, other)
__ipow__(self, other)
__mul__(self, other)
__pow__(self, other)
__rmul__(self, other)
__rpow__(self, other)

Opérateurs hérités de la classe ndarray

__add__, __and__, __contains__, __delitem__, __eq__, __floordiv__, __ge__, __gt__, __iadd__, __iand__, __ifloordiv__, __ilshift__, __imatmul__, __imod__, __invert__, __ior__, __irshift__, __isub__, __itruediv__, __ixor__, __le__, __lshift__, __lt__, __matmul__, __mod__, __ne__, __neg__, __or__, __pos__, __radd__, __rand__, __rfloordiv__, __rlshift__, __rmod__, __ror__, __rrshift__, __rshift__, __rsub__, __rtruediv__, __rxor__, __setitem__, __sub__, __truediv__, __xor__

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__array_finalize__(self, obj)
all(self, axis=None, out=None)
any(self, axis=None, out=None)
argmax(self, axis=None, out=None)
argmin(self, axis=None, out=None)
flatten(self, order='C')
getA(self)
getA1(self)
getH(self)
getI(self)
getT(self)
max(self, axis=None, out=None)
mean(self, axis=None, dtype=None, out=None)
min(self, axis=None, out=None)
prod(self, axis=None, dtype=None, out=None)
ptp(self, axis=None, out=None)
ravel(self, order='C')
squeeze(self, axis=None)
std(self, axis=None, dtype=None, out=None, ddof=0)
sum(self, axis=None, dtype=None, out=None)
tolist(self)
var(self, axis=None, dtype=None, out=None, ddof=0)

Méthodes héritées de la classe ndarray

__abs__, __array__, __array_function__, __array_prepare__, __array_ufunc__, __array_wrap__, __bool__, __complex__, __copy__, __deepcopy__, __divmod__, __float__, __format__, __index__, __init_subclass__, __int__, __iter__, __len__, __rdivmod__, __reduce__, __reduce_ex__, __repr__, __rmatmul__, __setstate__, __sizeof__, __str__, __subclasshook__, argpartition, argsort, astype, byteswap, choose, clip, compress, conj, conjugate, copy, cumprod, cumsum, diagonal, dot, dump, dumps, fill, getfield, item, itemset, newbyteorder, nonzero, partition, put, repeat, reshape, resize, round, searchsorted, setfield, setflags, sort, swapaxes, take, tobytes, tofile, tostring, trace, transpose, view

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __hash__, __init_subclass__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__