-
Notifications
You must be signed in to change notification settings - Fork 2
Tutorial: conversions
Paul Alexander Bilokon edited this page Dec 15, 2024
·
1 revision
This tutorial demonstrates the usage of various conversion functions available in the thalesians.adiutor.conversions module.
numpy_datetime64 = np.datetime64('2019-09-10T14:19:31.357')
python_datetime = conv.numpy_datetime64_to_python_datetime(numpy_datetime64)
print(python_datetime) # Output: 2019-09-10 14:19:31.357000pandas_timestamp = pd.Timestamp('2019-09-10 14:19:31.357')
python_datetime = conv.pandas_timestamp_to_python_datetime(pandas_timestamp)
print(python_datetime) # Output: 2019-09-10 14:19:31.357000numpy_timedelta64 = np.timedelta64(5, 's')
python_timedelta = conv.numpy_timedelta64_to_python_timedelta(numpy_timedelta64)
print(python_timedelta) # Output: 0:00:05... (continue similarly for all other methods from the test cases, providing examples and expected outputs)
Refer to the test cases for a comprehensive list of supported formats and use cases.