PHP 8.0.30
Preview: dtypes.py Size: 2.18 KB
//opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/dtypes.py

"""
DType classes and utility (:mod:`numpy.dtypes`)
===============================================

This module is home to specific dtypes related functionality and their classes.
For more general information about dtypes, also see `numpy.dtype` and
:ref:`arrays.dtypes`.

Similar to the builtin ``types`` module, this submodule defines types (classes)
that are not widely used directly.

.. versionadded:: NumPy 1.25

    The dtypes module is new in NumPy 1.25.  Previously DType classes were
    only accessible indirectly.


DType classes
-------------

The following are the classes of the corresponding NumPy dtype instances and
NumPy scalar types.  The classes can be used in ``isinstance`` checks and can
also be instantiated or used directly.  Direct use of these classes is not
typical, since their scalar counterparts (e.g. ``np.float64``) or strings
like ``"float64"`` can be used.

.. list-table::
    :header-rows: 1

    * - Group
      - DType class

    * - Boolean
      - ``BoolDType``

    * - Bit-sized integers
      - ``Int8DType``, ``UInt8DType``, ``Int16DType``, ``UInt16DType``,
        ``Int32DType``, ``UInt32DType``, ``Int64DType``, ``UInt64DType``

    * - C-named integers (may be aliases)
      - ``ByteDType``, ``UByteDType``, ``ShortDType``, ``UShortDType``,
        ``IntDType``, ``UIntDType``, ``LongDType``, ``ULongDType``,
        ``LongLongDType``, ``ULongLongDType``

    * - Floating point
      - ``Float16DType``, ``Float32DType``, ``Float64DType``,
        ``LongDoubleDType``

    * - Complex
      - ``Complex64DType``, ``Complex128DType``, ``CLongDoubleDType``

    * - Strings
      - ``BytesDType``, ``BytesDType``

    * - Times
      - ``DateTime64DType``, ``TimeDelta64DType``

    * - Others
      - ``ObjectDType``, ``VoidDType``

"""

__all__ = []


def _add_dtype_helper(DType, alias):
    # Function to add DTypes a bit more conveniently without channeling them
    # through `numpy.core._multiarray_umath` namespace or similar.
    from numpy import dtypes

    setattr(dtypes, DType.__name__, DType)
    __all__.append(DType.__name__)

    if alias:
        alias = alias.removeprefix("numpy.dtypes.")
        setattr(dtypes, alias, DType)
        __all__.append(alias)

Directory Contents

Dirs: 20 × Files: 22

Name Size Perms Modified Actions
array_api DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
compat DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
core DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
distutils DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
doc DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
f2py DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
fft DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
lib DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
linalg DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
ma DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
matrixlib DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
random DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
testing DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
tests DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
typing DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
_typing DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
_utils DIR
- drwxr-xr-x 2026-07-22 02:19:43
Edit Download
- drwxr-xr-x 2026-07-22 02:20:04
Edit Download
4.51 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
16.84 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
7.79 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
2.18 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
1.28 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
7.17 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
600 B lrw-r--r-- 2026-06-16 08:49:16
Edit Download
44.62 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
10.22 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
0 B lrw-r--r-- 2026-06-16 08:49:16
Edit Download
1.11 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
623 B lrw-r--r-- 2026-06-16 08:49:16
Edit Download
331 B lrw-r--r-- 2026-06-16 08:49:16
Edit Download
3.02 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
6.51 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
489 B lrw-r--r-- 2026-06-16 08:49:16
Edit Download
498 B lrw-r--r-- 2026-06-16 08:49:16
Edit Download
5.02 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
35.81 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
34.22 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
16.10 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download
150.11 KB lrw-r--r-- 2026-06-16 08:49:16
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).