Overview:
-
SciPy represents time and date using the class datetime64. The datetime64 class does not recognise time zones. All the time objects created by datetime64 are in UTC.
-
The function numpy.datetime_as_string() converts an ndarray of datetime64 objects into an ndarray of strings.
Example:
# Example Python program that converts an ndarray of # Create an ndarray of timestamps # Convert the datetime64 objects to strings print("Type of ndarray:") |
Output:
Type of ndarray: <class 'numpy.dtypes.DateTime64DType'> Type of ndarray: <class 'numpy.dtypes.StrDType'> |