You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 4, 2021. It is now read-only.
(For the record, it works up until the first dtype, or with regular dtypes that don't have any named fields: PyArray_GetPtr([1, 0]) != PyArray_GetPtr([2, 0])
Potentially because named dtypes don't really have an order? Either way, that's why we have "sub_coordinates" and "offset" counters for keeping track of where in the array we are at. Would love to get rid of that extra code and computation and rely on a Numpy API call.
The text was updated successfully, but these errors were encountered:
Exactly, the PyArray_GetPtr method will only give you the pointer to the level above the named dtypes. So while you can pass extra arguments to the function, it will ignore them, so we have a bunch of extra code in there to handle that. It seems like there should be something that works out of the box since it's not an usual use case, but it requires some research and testing.
Closing this as we have discontinued development of BSON-NumPy. PyMongoArrow is now the recommended way to materialize MongoDB query results as NumPy ndarrays as well as tabular formats like Pandas' DataFrames and PyArrow Tables.
PyArray_GetPtr does not descend into named dtypes.
Example:
In C:
(For the record, it works up until the first dtype, or with regular dtypes that don't have any named fields:
PyArray_GetPtr([1, 0]) != PyArray_GetPtr([2, 0])
Potentially because named dtypes don't really have an order? Either way, that's why we have "sub_coordinates" and "offset" counters for keeping track of where in the array we are at. Would love to get rid of that extra code and computation and rely on a Numpy API call.
The text was updated successfully, but these errors were encountered: