From 26a0dc814d76da7c6fd9be4ed40d22ea1c0e04fc Mon Sep 17 00:00:00 2001 From: Rupa-Rd Date: Mon, 20 May 2024 22:48:00 +0530 Subject: [PATCH] Example for object type is added --- contrib/numpy/datatypes.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/contrib/numpy/datatypes.md b/contrib/numpy/datatypes.md index 616d6c3..6107d8d 100644 --- a/contrib/numpy/datatypes.md +++ b/contrib/numpy/datatypes.md @@ -168,7 +168,18 @@ The `datetime64()` is used to define the date, month and year. ## Example for string type ## Example for object type +``` python + import numpy as np + arr = np.object_([1, 2, 3, 4]) + + print(arr) + print(arr.dtype) + + # Output: + # [1, 2, 3, 4] + # object +``` ## Example for unicode string type ## Example for timedelta type