I need to create an array of numpy datetime64 objects from C/C++ code. As you can see for NPY_LONGLONG
and NPY_VOID
I did it. I need to do the same thing for NPY_DATETIME
type.
PyObject *arr1 = PyArray_SimpleNew(1, &dims, NPY_LONGLONG);
PyObject *arr2 = PyArray_New(&PyArray_Type, 1, &dims, NPY_VOID, NULL, NULL, item_size, 0, NULL);
The problem is that there is no documentation about what is the internal representation of NPY_DATETIME
type, so I don't know if it has an fixed size, structure or not.
It would be great if you put an example like I did for NPY_LONGLONG
and NPY_VOID
.