From 92beeba6c21b6cb27242d91fb6f6bd4ed3b019ba Mon Sep 17 00:00:00 2001 From: Rupa-Rd Date: Mon, 20 May 2024 21:54:39 +0530 Subject: [PATCH] dtype() definition and example is added --- contrib/numpy/datatypes.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/contrib/numpy/datatypes.md b/contrib/numpy/datatypes.md index 768add1..39dd46b 100644 --- a/contrib/numpy/datatypes.md +++ b/contrib/numpy/datatypes.md @@ -14,6 +14,17 @@ Numpy supports the following data types: - `S` - string - `U` - unicode string +## dtype() Function +The `dtype()` function returns the type of the NumPy array object. +``` python + import numpy as np + + arr = np.array([1, 2, 3, 4]) + + print(arr.dtype) + + # Output: int64 +``` ## Example for integer type ## Example for float type @@ -33,3 +44,6 @@ Numpy supports the following data types: ## Example for unicode string type ## Example for timedelta type + +# Data Type Conversion +