Create an array that shares the given numpy data. Parameters ---------- np_data : numpy.ndarray The numpy data Returns ------- NDArray The array
(np_data)
| 105 | |
| 106 | |
| 107 | def zerocopy_from_numpy(np_data): |
| 108 | """Create an array that shares the given numpy data. |
| 109 | |
| 110 | Parameters |
| 111 | ---------- |
| 112 | np_data : numpy.ndarray |
| 113 | The numpy data |
| 114 | |
| 115 | Returns |
| 116 | ------- |
| 117 | NDArray |
| 118 | The array |
| 119 | """ |
| 120 | arr, _ = numpyasarray(np_data) |
| 121 | handle = ctypes.pointer(arr) |
| 122 | return NDArray(handle, is_view=True) |
| 123 | |
| 124 | |
| 125 | def cast_to_signed(arr): |
nothing calls this directly
no test coverage detected