NumPy
numpy.org › devdocs › reference › generated › numpy.ndarray.astype.html
numpy.ndarray.astype — NumPy v2.6.dev0 Manual
If True, then sub-classes will be passed-through (default), otherwise the returned array will be forced to be a base-class array. ... By default, astype always returns a newly allocated array.
Programiz
programiz.com › python-programming › numpy › methods › astype
NumPy astype()
The astype() method converts an array to a specified data type. The astype() method converts an array to a specified data type. Example import numpy as np # original array of integers integerArray = np.array([1, 2, 3, 4, 5]) # convert array to floating-point numbers floatArray = integerArr...
Videos
12:00
NumPy Data Types | astype function in NumPy | NumPy Datatypes - ...
01:36
astype in NumPy Python | Module NumPy Tutorial - Part 05 - YouTube
07:24
Python NumPy Tutorial For Beginners - NumPy Astype method - YouTube
07:29
How to Use the Astype Method in Python to Convert Data Types - YouTube
[PYTHON][numpy-12] ndarray변환 - reshape, flatten, astype
07:23
Lesson 16 –Converting Data Type in Existing Numpy Array for Machine ...
NumPy
numpy.org › doc › 2.0 › reference › generated › numpy.astype.html
numpy.astype — NumPy v2.0 Manual
Copies an array to a specified data type.
NumPy
numpy.org › doc › stable › reference › generated › numpy.ndarray.astype.html
numpy.ndarray.astype — NumPy v2.4 Manual
If True, then sub-classes will be passed-through (default), otherwise the returned array will be forced to be a base-class array. ... By default, astype always returns a newly allocated array.
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.ndarray.astype.html
numpy.ndarray.astype — NumPy v2.1 Manual
If True, then sub-classes will be passed-through (default), otherwise the returned array will be forced to be a base-class array. ... By default, astype always returns a newly allocated array.
W3Schools
w3schools.com › python › numpy › numpy_data_types.asp
NumPy Data Types
The astype() function creates a copy of the array, and allows you to specify the data type as a parameter. The data type can be specified using a string, like 'f' for float, 'i' for integer etc. or you can use the data type directly like float ...
Codecademy
codecademy.com › docs › python:numpy › ndarray › .astype()
Python:NumPy | ndarray | .astype() | Codecademy
July 18, 2024 - The .astype() function in NumPy allows changing the data type of the elements in an array.
NumPy
numpy.org › devdocs › reference › generated › numpy.astype.html
numpy.astype — NumPy v2.5.dev0 Manual
Copies an array to a specified data type.
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.ndarray.astype.html
numpy.ndarray.astype — NumPy v2.2 Manual
If True, then sub-classes will be passed-through (default), otherwise the returned array will be forced to be a base-class array. ... By default, astype always returns a newly allocated array.
GeeksforGeeks
geeksforgeeks.org › numpy › change-numpy-array-data-type
Change the Data Type of the Given NumPy Array - GeeksforGeeks
Using the NumPy.astype() function to change the data type of the underlying data of the given NumPy array.
Published July 11, 2025
NumPy
numpy.org › doc › stable › reference › generated › numpy.astype.html
numpy.astype — NumPy v2.4 Manual
Copies an array to a specified data type.
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.ndarray.astype.html
numpy.ndarray.astype — NumPy v2.3 Manual
If True, then sub-classes will be passed-through (default), otherwise the returned array will be forced to be a base-class array. ... By default, astype always returns a newly allocated array.
NumPy
numpy.org › doc › 2.0 › reference › generated › numpy.ndarray.astype.html
numpy.ndarray.astype — NumPy v2.0 Manual
If True, then sub-classes will be passed-through (default), otherwise the returned array will be forced to be a base-class array. ... By default, astype always returns a newly allocated array.
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.astype.html
numpy.astype — NumPy v2.2 Manual
Copies an array to a specified data type.
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.char.chararray.astype.html
numpy.char.chararray.astype — NumPy v2.3 Manual
Copy of the array, cast to a specified type.
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.char.chararray.astype.html
numpy.char.chararray.astype — NumPy v2.1 Manual
Copy of the array, cast to a specified type.
TutorialKart
tutorialkart.com › numpy › numpy-ndarray-astype
NumPy ndarray.astype() Method:
January 29, 2025 - import numpy as np # Creating a float array arr = np.array([1.2, 2.5, 3.8]) # Safe casting to integer (prevents unsafe conversions) try: int_arr = arr.astype(int, casting='safe') print("Converted array:", int_arr) except TypeError as e: print("Error:", e)
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.astype.html
numpy.astype — NumPy v2.1 Manual
Specifies whether to copy an array when the specified dtype matches the data type of the input array x. If True, a newly allocated array must always be returned. If False and the specified dtype matches the data type of the input array, the input array must be returned; otherwise, a newly allocated ...