astype in NumPy Python | Module NumPy Tutorial - Part 05

Опубликовано: 12 Март 2025
на канале: Koolac
3,044
51

In this video, we will talk about astype function in numpy module python with example. Maybe you ask: How do I convert a NumPy array to integer? or float or ....? And the answer to all of these questions is: using the astype function.

==================================
NumPy Module Tutorial Playlist for Machine Learning:
==================================
   • Numpy Python Playlist  

==================================
Source Code:
==================================
import numpy as np
x=np.array(["1","2","3"])
y=x.astype(float)
print(y)
print(y.dtype)