- Notifications
You must be signed in to change notification settings - Fork752
Open
Labels
Description
Copying data from NumPy array to C# is a common task. Python.NET implements a simple sequence-to-array copying mechanism, which uses iterators. It is extremely inefficient for large arrays of primitive types.
Now we have a better way - usingPyBuffer
andbuffer protocol. We could detect, that Python object implements the buffer protocol, use it to copy data when possible, and fallback to iteration otherwise.