Module « numpy.matlib »
Classe « broadcast »
Informations générales
Héritage
builtins.object
broadcast
Définition
class broadcast(builtins.object):
Description [extrait de broadcast.__doc__]
Produce an object that mimics broadcasting.
Parameters
----------
in1, in2, ... : array_like
Input parameters.
Returns
-------
b : broadcast object
Broadcast the input parameters against one another, and
return an object that encapsulates the result.
Amongst others, it has ``shape`` and ``nd`` properties, and
may be used as an iterator.
See Also
--------
broadcast_arrays
broadcast_to
broadcast_shapes
Examples
--------
Manually adding two vectors, using broadcasting:
>>> x = np.array([[1], [2], [3]])
>>> y = np.array([4, 5, 6])
>>> b = np.broadcast(x, y)
>>> out = np.empty(b.shape)
>>> out.flat = [u+v for (u,v) in b]
>>> out
array([[5., 6., 7.],
[6., 7., 8.],
[7., 8., 9.]])
Compare against built-in broadcasting:
>>> x + y
array([[5, 6, 7],
[6, 7, 8],
[7, 8, 9]])
Constructeur(s)
__new__(*args, **kwargs) |
Create and return a new object. See help(type) for accurate signature. [extrait de __new__.__doc__] |
Liste des attributs statiques
index | <attribute 'index' of 'numpy.broadcast' objects> |
iters | <attribute 'iters' of 'numpy.broadcast' objects> |
nd | <member 'nd' of 'numpy.broadcast' objects> |
ndim | <member 'ndim' of 'numpy.broadcast' objects> |
numiter | <member 'numiter' of 'numpy.broadcast' objects> |
shape | <attribute 'shape' of 'numpy.broadcast' objects> |
size | <attribute 'size' of 'numpy.broadcast' objects> |
Liste des opérateurs
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
__iter__(self) |
Implement iter(self). [extrait de __iter__.__doc__] |
__next__(self) |
Implement next(self). [extrait de __next__.__doc__] |
reset |
reset() [extrait de reset.__doc__] |
Méthodes héritées de la classe object
__delattr__,
__dir__,
__format__,
__getattribute__,
__hash__,
__init_subclass__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__sizeof__,
__str__,
__subclasshook__
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 :