Vous êtes un professionnel et vous avez besoin d'une formation ?
Machine Learning
avec Scikit-Learn
Voir le programme détaillé
Module « numpy.matlib »
Classe « void »
Informations générales
Héritage
builtins.object
generic
flexible
void
Définition
class void(flexible):
help(void)
np.void(length_or_data, /, dtype=None)
Create a new structured or unstructured void scalar.
Parameters
----------
length_or_data : int, array-like, bytes-like, object
One of multiple meanings (see notes). The length or
bytes data of an unstructured void. Or alternatively,
the data to be stored in the new scalar when `dtype`
is provided.
This can be an array-like, in which case an array may
be returned.
dtype : dtype, optional
If provided the dtype of the new scalar. This dtype must
be "void" dtype (i.e. a structured or unstructured void,
see also :ref:`defining-structured-types`).
.. versionadded:: 1.24
Notes
-----
For historical reasons and because void scalars can represent both
arbitrary byte data and structured dtypes, the void constructor
has three calling conventions:
1. ``np.void(5)`` creates a ``dtype="V5"`` scalar filled with five
``\0`` bytes. The 5 can be a Python or NumPy integer.
2. ``np.void(b"bytes-like")`` creates a void scalar from the byte string.
The dtype itemsize will match the byte string length, here ``"V10"``.
3. When a ``dtype=`` is passed the call is roughly the same as an
array creation. However, a void scalar rather than array is returned.
Please see the examples which show all three different conventions.
Examples
--------
>>> np.void(5)
np.void(b'\x00\x00\x00\x00\x00')
>>> np.void(b'abcd')
np.void(b'\x61\x62\x63\x64')
>>> np.void((3.2, b'eggs'), dtype="d,S5")
np.void((3.2, b'eggs'), dtype=[('f0', '<f8'), ('f1', 'S5')])
>>> np.void(3, dtype=[('x', np.int8), ('y', np.int8)])
np.void((3, 3), dtype=[('x', 'i1'), ('y', 'i1')])
:Character code: ``'V'``
Constructeur(s)
Liste des attributs statiques
base | <attribute 'base' of 'numpy.void' objects> |
dtype | <attribute 'dtype' of 'numpy.void' objects> |
flags | <attribute 'flags' of 'numpy.void' objects> |
Attributs statiques hérités de la classe generic
data, device, flat, imag, itemset, itemsize, nbytes, ndim, newbyteorder, ptp, real, shape, size, strides, T
Liste des opérateurs
__delitem__(self, key) |
Delete self[key]. [extrait de __delitem__.__doc__] |
__eq__(self, value) |
Return self==value. [extrait de __eq__.__doc__] |
__ge__(self, value) |
Return self>=value. [extrait de __ge__.__doc__] |
__getitem__(self, key) |
Return self[key]. [extrait de __getitem__.__doc__] |
__gt__(self, value) |
Return self>value. [extrait de __gt__.__doc__] |
__le__(self, value) |
Return self<=value. [extrait de __le__.__doc__] |
__lt__(self, value) |
Return self<value. [extrait de __lt__.__doc__] |
__ne__(self, value) |
Return self!=value. [extrait de __ne__.__doc__] |
__setitem__(self, key, value) |
Set self[key] to value. [extrait de __setitem__.__doc__] |
Opérateurs hérités de la classe generic
__add__,
__and__,
__floordiv__,
__invert__,
__lshift__,
__mod__,
__mul__,
__neg__,
__or__,
__pos__,
__pow__,
__radd__,
__rand__,
__rfloordiv__,
__rlshift__,
__rmod__,
__rmul__,
__ror__,
__rpow__,
__rrshift__,
__rshift__,
__rsub__,
__rtruediv__,
__rxor__,
__sub__,
__truediv__,
__xor__
Liste des méthodes
Toutes les méthodes
Méthodes d'instance
Méthodes statiques
Méthodes dépréciées
Méthodes héritées de la classe flexible
__init_subclass__,
__subclasshook__
Méthodes héritées de la classe generic
__abs__,
__array__,
__array_namespace__,
__array_wrap__,
__bool__,
__copy__,
__deepcopy__,
__divmod__,
__float__,
__format__,
__init_subclass__,
__int__,
__rdivmod__,
__reduce__,
__setstate__,
__sizeof__,
__subclasshook__,
all,
any,
argmax,
argmin,
argsort,
astype,
byteswap,
choose,
clip,
compress,
conj,
conjugate,
copy,
cumprod,
cumsum,
diagonal,
dump,
dumps,
fill,
flatten,
item,
max,
mean,
min,
nonzero,
prod,
put,
ravel,
repeat,
reshape,
resize,
round,
searchsorted,
setflags,
sort,
squeeze,
std,
sum,
swapaxes,
take,
to_device,
tobytes,
tofile,
tolist,
tostring,
trace,
transpose,
var,
view
Méthodes héritées de la classe object
__delattr__,
__dir__,
__format__,
__getattribute__,
__getstate__,
__init_subclass__,
__reduce__,
__reduce_ex__,
__setattr__,
__sizeof__,
__subclasshook__
Vous êtes un professionnel et vous avez besoin d'une formation ?
Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé
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 :