NPY_LONGLONG
和NPY_VOID
我做到了。我需要对NPY_DATETIME
类型执行相同的操作。在PyObject *arr1 = PyArray_SimpleNew(1, &dims, NPY_LONGLONG);
PyObject *arr2 = PyArray_New(&PyArray_Type, 1, &dims, NPY_VOID, NULL, NULL, item_size, 0, NULL);
问题是没有关于NPY_DATETIME
类型的内部表示的文档,因此我不知道它是否具有固定的大小、结构。在
如果您像我为NPY_LONGLONG
和NPY_VOID
举一个例子,那就太好了。在
我找到了一个好办法。这是我的函数,它从一个C缓冲区创建numpy数组。在
dtype
是M8[ms]或M8[us]或M8[ns]。在相关问题 更多 >
编程相关推荐