Région de recherche :

Date :

https://numpy.org › doc › stable › reference › arrays.dtypes.html

Data type objects (dtype) — NumPy v2.1 Manual

Example. A structured data type containing a 16-character string (in field ‘name’) and a sub-array of two 64-bit floating-point number (in field ‘grades’): >>> import numpy as np. >>> dt = np.dtype([('name', np.str_, 16), ('grades', np.float64, (2,))]) >>> dt['name'] dtype('<U16') >>> dt['grades'] dtype(('<f8', (2,)))

https://numpy.org › doc › stable › reference › generated › numpy.dtype.html

numpy.dtype — NumPy v2.1 Manual

Create a data type object. A numpy array is homogeneous, and contains elements described by a dtype object. A dtype object can be constructed from different combinations of fundamental numeric types. Parameters: dtype. Object to be converted to a data type object. alignbool, optional.

https://docs.scipy.org › doc › numpy-1.13.0 › reference › arrays.dtypes.html

Data type objects (dtype) — NumPy v1.13 Manual - SciPy.org

Example. A structured data type containing a 16-character string (in field ‘name’) and a sub-array of two 64-bit floating-point number (in field ‘grades’): >>> dt=np.dtype( [ ('name',np.unicode_,16),('grades',np.float64,(2,))])>>> dt['name']dtype ('|U16')>>> dt['grades']dtype ( ('float64', (2,)))

https://numpy.org › doc › stable › user › basics.types.html

Data types — NumPy v2.1 Manual

NumPy numerical types are instances of numpy.dtype (data-type) objects, each having unique characteristics. Once you have imported NumPy using import numpy as np you can create arrays with a specified dtype using the scalar types in the numpy top-level API, e.g. numpy.bool, numpy.float32, etc.

https://www.slingacademy.com › article › a-detailed-guide-to-ndarray-dtype-attribute-in...

A detailed guide to ndarray.dtype attribute in NumPy (5 examples)

The ndarray.dtype attribute in NumPy describes the data type of the elements in an ndarray (N-dimensional array). Knowing the dtype of your NumPy array is critical for performing efficient numeric computations and data analysis in Python.

https://runebook.dev › fr › docs › numpy › reference › arrays.dtypes

NumPy - dtype object [fr] - Runebook.dev

Example. Un type de données structurées contenant une chaîne de 16 caractères (dans le champ « nom ») et un sous-tableau de deux nombres à virgule flottante de 64 bits (dans le champ « notes ») : >>>dt = np.dtype ( [ ('name', np.unicode_, 16), ('grades', np.float64, (2,))])>>>dt ['name'] dtype ('<U16') >>>dt ['grades'] dtype ( ('<f8', (2,)))

https://stackoverflow.com › questions › 9457037

python - what does .dtype do? - Stack Overflow

By changing the dtype in this way, you are changing the way a fixed block of memory is being interpreted. Example: >>> import numpy as np >>> a=np.array([1,0,0,0,0,0,0,0],dtype='int8') >>> a array([1, 0, 0, 0, 0, 0, 0, 0], dtype=int8) >>> a.dtype='int64' >>> a array([1])

https://www.geeksforgeeks.org › numpy-ndarray-dtype

NumPy ndarray.dtype Property | Get Data Type of ... - GeeksforGeeks

The ndarray.dtype attribute returns the data type of the array’s elements. This attribute is read-only and cannot be modified directly. Example. Python3. import numpy as geek . arr = geek.array([[0, 1], [2, 3]]) . gfg = arr.dtype . print (gfg) . Output : int64. Syntax: numpy.ndarray.dtype. Parameters : None.

https://numpy.org › doc › stable › reference › arrays.ndarray.html

The N-dimensional array (ndarray) — NumPy v2.1 Manual

The type of items in the array is specified by a separate data-type object (dtype), one of which is associated with each ndarray. As with other container objects in Python, the contents of an ndarray can be accessed and modified by indexing or slicing the array (using, for example, N integers), and via the methods and attributes of the ndarray.

https://note.nkmk.me › en › python-numpy-dtype-astype

NumPy: astype() to change dtype of an array | note.nkmk.me - nkmk note

NumPy arrays (ndarray) hold a data type (dtype). You can set this through various operations, such as when creating an ndarray with np.array(), or change it later with astype(). Data type objects (dtype) — NumPy v1.26 Manual. numpy.ndarray.astype — NumPy v1.26 Manual. Contents.