Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Data type conversion method of NumPy multi-dimensional array

Shulou Source: shulou.com Published: 2022-06-02 06:31:47 10月04日 Update

This article mainly explains "the method of data type conversion of NumPy multi-dimensional array". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn the "NumPy multi-dimensional array data type conversion method"!

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license ()" for more information. > > import numpy as np > > a = np.arange (12). Reshape (3) > aarray ([[0,1,2,3], [4,5,6,7], [8,9,10] 11]]) > a.dtypedtype ('int32') > b = np.array (a, dtype=np.float32) > barray ([[0, 1, 2, 3.], [4, 5, 6, 7.], [8, 9, 10, 11.], dtype=float32) > > b.dtypedtype (' float32') > so far I believe you have a deeper understanding of the data type conversion method of NumPy multi-dimensional array, so you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Method data array type multidimensional content learning practical deeper interest practical practical easy to operate more friends websites channels query Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Technology Shulou Tech Info NVidia Xiaomi